Apama  9.12.0.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com::softwareag::connectivity::AbstractSimpleTransport Class Referenceabstract

Base class that simplifies implementation of transport plug-ins that deal only with individual messages not batches, and ignore messages with null payloads. More...

#include <sag_connectivity_plugins.hpp>

Inheritance diagram for com::softwareag::connectivity::AbstractSimpleTransport:
com::softwareag::connectivity::AbstractTransport com::softwareag::connectivity::Plugin com::softwareag::connectivity::TransportSide

Public Member Functions

 AbstractSimpleTransport (const std::string &name, const std::string &chainId, const map_t &config)
 Legacy constructor. More...
 
 AbstractSimpleTransport (const PluginConstructorParameters::TransportConstructorParameters &params)
 Constructor. More...
 
virtual void sendBatchTowardsTransport (Message *start, Message *end)
 Implements batch sending, calling deliverMessageTowardsTransport(Message&) for each message individually. More...
 
virtual void deliverMessageTowardsTransport (Message &msg)=0
 Abstract method that must be implemented to handle delivery of an individual message. More...
 
virtual void deliverNullPayloadTowardsTransport (Message &msg)
 Deliver a message with a null payload. More...
 
virtual void handleException (Message &m)
 Handle an exception thrown while delivering a message towards the transport. More...
 
- Public Member Functions inherited from com::softwareag::connectivity::AbstractTransport
 AbstractTransport (const std::string &name, const std::string &chainId, const map_t &config)
 Legacy constructor. More...
 
 AbstractTransport (const PluginConstructorParameters::TransportConstructorParameters &params)
 Constructor. More...
 
- Public Member Functions inherited from com::softwareag::connectivity::Plugin
virtual ~Plugin ()
 Virtual destructor to ensure that we can delete any part of the tree. More...
 
virtual void start ()
 Called when an entire chain has been created and the plugin is allowed to start up (after all plugins are connected together). More...
 
virtual void hostReady ()
 Called some time after start(), when the host is ready to start receiving input (sends will be queued until this point). More...
 
virtual void shutdown ()
 Release any resources created by the connectivity plug-in, and terminate and join any background threads. More...
 
const std::string & getName () const
 Return the name of this plugin instance. More...
 
- Public Member Functions inherited from com::softwareag::connectivity::TransportSide
virtual ~TransportSide ()
 Ensure virtual destruction. More...
 

Additional Inherited Members

- Public Types inherited from com::softwareag::connectivity::TransportSide
typedef std::auto_ptr
< TransportSide
ptr_t
 Pointers to TransportSides should always be this ptr_t type, which is a std::auto_ptr. More...
 
- Public Attributes inherited from com::softwareag::connectivity::Plugin
Logger LOGGER
 Legacy logging for writing to the host log file. More...
 
Logger logger
 Logging for writing to the host log file. More...
 
- Protected Attributes inherited from com::softwareag::connectivity::AbstractTransport
HostSide::ptr_t hostSide
 The next plug-in in the chain towards host. More...
 
- Protected Attributes inherited from com::softwareag::connectivity::Plugin
std::string name
 The name used for this plug-in in the configuration file. More...
 
std::string chainId
 The identifier used for the chain this plug-in is part of. More...
 
map_t config
 The configuration of this plug-in. More...
 

Detailed Description

Base class that simplifies implementation of transport plug-ins that deal only with individual messages not batches, and ignore messages with null payloads.

To export a transport class for use in the host you should use the SAG_DECLARE_CONNECTIVITY_TRANSPORT_CLASS(Class) macro, and provide a public constructor with the same signature as AbstractSimpleTransport(const PluginConstructorParameters::TransportConstructorParameters &).

The legacy constructor AbstractTransport(const std::string &name, const std::string &chainId, const map_t &config) and SAG_DECLARE_CONNECTIVITY_TRANSPORT(Class) macro are still permitted as an alternative but should not be used for new plug-ins.

Plug-in authors will typically extend this class by providing at least valid constructor, an implementation of deliverMessageTowardsTransport(Message&), and sending messages towards the hostSide from a background thread created in start().

Constructor & Destructor Documentation

com::softwareag::connectivity::AbstractSimpleTransport::AbstractSimpleTransport ( const std::string &  name,
const std::string &  chainId,
const map_t config 
)
inline

Legacy constructor.

This can only be used with the legacy macro SAG_DECLARE_CONNECTIVITY_TRANSPORT(Class) and will be deprecated in a future release. Please use the alternative constructor signature AbstractSimpleTransport(const PluginConstructorParameters::TransportConstructorParameters &) instead for new plug-ins that use the SAG_DECLARE_CONNECTIVITY_TRANSPORT_CLASS(Class) macro.

A plug-in should throw an exception from the constructor if there is a problem with the configuration or any other error that will prevent the plug-in from working correctly.

Parameters
pluginNameThe name used in the configuration file for this plug-in.
chainIdThe identifier used for the chain this plug-in is part of.
configThe configuration for this plug-in.
com::softwareag::connectivity::AbstractSimpleTransport::AbstractSimpleTransport ( const PluginConstructorParameters::TransportConstructorParameters params)
inline

Constructor.

A subclass should provide its own constructor with the same signature as this one.

A plug-in should throw an exception from the constructor if there is a problem with the configuration or any other error that will prevent the plug-in from working correctly.

Parameters
paramsProvides access to the configuration for this plug-in, and other capabilities.
Since
9.12.0.1

Member Function Documentation

virtual void com::softwareag::connectivity::AbstractSimpleTransport::deliverMessageTowardsTransport ( Message msg)
pure virtual

Abstract method that must be implemented to handle delivery of an individual message.

virtual void com::softwareag::connectivity::AbstractSimpleTransport::deliverNullPayloadTowardsTransport ( Message msg)
inlinevirtual

Deliver a message with a null payload.

Default is to ignore it

virtual void com::softwareag::connectivity::AbstractSimpleTransport::handleException ( Message m)
inlinevirtual

Handle an exception thrown while delivering a message towards the transport.

Default implementation is to log a warning and discard a message.

You can override it yourself to have other behaviour. The Message which caused the error is passed in.

This is called from within a catch block, so if you need to know the exception thrown then you can rethrow it yourself:

try {
throw;
} catch (const type &ex) {
...
}
virtual void com::softwareag::connectivity::AbstractSimpleTransport::sendBatchTowardsTransport ( Message start,
Message end 
)
inlinevirtual

Implements batch sending, calling deliverMessageTowardsTransport(Message&) for each message individually.

Any exceptions from deliverMessageTowardsTransport are caught and handleException(Message&) is called and then processing continues for the next message.

Implements com::softwareag::connectivity::TransportSide.


The documentation for this class was generated from the following file: