Apama  9.10.0.4.289795
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
com::softwareag::connectivity::AbstractTransport Class Reference

Abstract class for Transports. More...

#include <sag_connectivity_plugins.hpp>

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

Public Member Functions

 AbstractTransport (const std::string &name, const std::string &chainId, const map_t &config)
 Give the plugin instance name and the chain name. More...
 
virtual void setNextTowardsHost (HostSide::ptr_t &&host)
 Set the next in the chain towards the host. More...
 
- Public Member Functions inherited from com::softwareag::connectivity::Plugin
 Plugin (const std::string &name, const std::string &chainId, const map_t &config)
 Give the plugin instance name and the chain name. More...
 
virtual ~Plugin ()
 Virtual destructor to ensure that we can delete any part of the tree. More...
 
virtual void start ()
 Called when the plugin should be started up (after all plugins are connected together). More...
 
virtual void hostReady ()
 Called when the host indicates it 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...
 
virtual void sendBatchTowardsTransport (Message *start, Message *end)=0
 Process or deliver a batch of messages heading towards the transport. 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...
 

Detailed Description

Abstract class for Transports.

Base class that implementations of a Transport should derive from. Holds pointers to the next plug-in in the chain.

Some transports may need to respond to every message received from the host with a corresponding reply back towards the host. This has to be done carefully; if the implementation of TransportSide.sendBatchTowardsTransport() contains a simple synchronous call back to HostSide.sendBatchTowardsHost(), this has the potential to cause a deadlock in the host application, depending on the disposition of internal queues. Transports needing to follow this pattern should generate their responses on a distinct thread, not the thread that processes the message(s) from the host.

Transports must have a constructor with this signature: (const std::string &name, const std::string &chainId, const map_t &config)

The instanceConfiguration is any instance-specific configuration. The name is the name of this plug-in. chainId is the chain's identifier as named in the configuration. All should be passed to the AbstractTransport/ AbstractSimpleTransport constructor.

An exception should be thrown from the constructor if the configuration is invalid.

Derives from Plugin, which provides name, chainId and LOGGER. Derives from TransportSide, requiring derived classes to implement sendBatchTowardsTransport

Derive from AbstractTransport if you want to handle messages in batches. Events are delivered to or from transports in batches, which transports may be able to make use of to deliver many events in a single operation, amortizing the cost of delivering events. The division into batches is of no significance beyond them all being available for delivery within a short space of time - a transport should function the same if given the events individually or in batches.

Derive from AbstractSimpleTransport instead if your transport is only concerned with single messages at a time.

Constructor & Destructor Documentation

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

Give the plugin instance name and the chain name.

Member Function Documentation

virtual void com::softwareag::connectivity::AbstractTransport::setNextTowardsHost ( HostSide::ptr_t &&  host)
inlinevirtual

Set the next in the chain towards the host.


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