Apama  10.2.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com::softwareag::connectivity::Plugin Class Reference

Base of the inheritance tree for Connectivity plugins. More...

#include <sag_connectivity_plugins.hpp>

Inheritance diagram for com::softwareag::connectivity::Plugin:
com::softwareag::connectivity::AbstractCodec com::softwareag::connectivity::AbstractTransport com::softwareag::connectivity::AbstractSimpleCodec com::softwareag::connectivity::AbstractSimpleTransport

Public Member Functions

 Plugin (const std::string &pluginName, const std::string &chainId, const map_t &config)
 Legacy constructor [DEPRECATED]. More...
 
virtual ~Plugin ()
 This destructor must be virtual. 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 ()
 Stop processing messages and terminate and join any background threads. More...
 
const std::string & getName () const
 The name used for this plug-in in the configuration file. More...
 

Public Attributes

Logger LOGGER
 Legacy logging for writing to the host log file [DEPRECATED]. More...
 
Logger logger
 Logging for writing to the host log file. More...
 

Protected Member Functions

StatusReportergetStatusReporter ()
 Allows reporting status information from this plug-in, such as online or failed status and number of messages sent/received in each direction. More...
 

Protected Attributes

const std::string name
 The name used for this plug-in in the configuration file. More...
 
const std::string pluginName
 The name used for this plug-in in the configuration file. More...
 
const 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...
 
const PluginHost::ptr_t host
 Interface to support miscellaneous requests from this plug-in to the host system. More...
 

Detailed Description

Base of the inheritance tree for Connectivity plugins.

Normally plugins will implement either AbstractCodec or AbstractTransport, or one of their Simple variants.

This base class provides several useful members to its derived classes.

Constructor & Destructor Documentation

com::softwareag::connectivity::Plugin::Plugin ( const std::string &  pluginName,
const std::string &  chainId,
const map_t config 
)
inline

Legacy constructor [DEPRECATED].

Deprecated:
This constructor signature is deprecated, please use the alternative constructor.
virtual com::softwareag::connectivity::Plugin::~Plugin ( )
inlinevirtual

This destructor must be virtual.

Destroy any objects used by the plug-in - no method on the plug-in will be called after the destructor has begun.

Member Function Documentation

const std::string& com::softwareag::connectivity::Plugin::getName ( ) const
inline

The name used for this plug-in in the configuration file.

StatusReporter& com::softwareag::connectivity::Plugin::getStatusReporter ( )
inlineprotected

Allows reporting status information from this plug-in, such as online or failed status and number of messages sent/received in each direction.

Cannot be used with plug-ins that use the legacy constructor.

Since
10.0
virtual void com::softwareag::connectivity::Plugin::hostReady ( )
inlinevirtual

Called some time after start(), when the host is ready to start receiving input (sends will be queued until this point).

Plug-ins are not required to do anything at this point, though some transports may choose to avoid pulling messages from an external system until the host is ready.

Default implementation is a no-op.

virtual void com::softwareag::connectivity::Plugin::shutdown ( )
inlinevirtual

Stop processing messages and terminate and join any background threads.

The host will call this before shutdown.

This method will never be called more than once on this instance. Implementations should ensure they work correctly even if the start() method was not called.

This method may be called while messages are still being delivered towards the host or transport (it is even possible for messages to be delivered towards the transport after this method has returned - the plug-in should discard any messages sent to it after this point rather than attempt to process or deliver them). If the plug-in is blocked waiting to send a message, it should attempt to cancel the operation and unblock any threads sending messages transportwards when this method is called. The plug-in must ensure that any calls to hostSide or transportSide are completed before returning from this method and not initiate any calls after this has completed. This is typically achieved by interrupting and joining any threads that this plug-in has started (i.e. waiting for the threads to terminate).

The plug-in must be left in a valid state - messages may be delivered to it after this call has completed; destroying objects and releasing can be done safely in the destructor.

Default implementation is a no-op. You must override it if you need to wait for anything, and typically a transport will need to implement it to stop processing further messages.

virtual void com::softwareag::connectivity::Plugin::start ( )
inlinevirtual

Called when an entire chain has been created and the plugin is allowed to start up (after all plugins are connected together).

Some plug-ins will initiate a connection or create background threads in their start method.

You must not call methods on hostSide or transportSide before start() is called.

The start method will never be called more than once on this instance.

Default implementation is a no-op.

Member Data Documentation

const std::string com::softwareag::connectivity::Plugin::chainId
protected

The identifier used for the chain this plug-in is part of.

map_t com::softwareag::connectivity::Plugin::config
protected

The configuration of this plug-in.

The plug-in owns and is free to mutate this data structure.

const PluginHost::ptr_t com::softwareag::connectivity::Plugin::host
protected

Interface to support miscellaneous requests from this plug-in to the host system.

Cannot be used with plug-ins that use the legacy constructor.

Logger com::softwareag::connectivity::Plugin::LOGGER

Legacy logging for writing to the host log file [DEPRECATED].

Deprecated:
Use the logger field instead of this; the behaviour is identical but this field is deprecated to improve naming consistency.
Logger com::softwareag::connectivity::Plugin::logger

Logging for writing to the host log file.

Since
9.12.0.1
const std::string com::softwareag::connectivity::Plugin::name
protected

The name used for this plug-in in the configuration file.

[DEPRECATED]

Deprecated:
Please use the identical "pluginName" field instead of this.
const std::string com::softwareag::connectivity::Plugin::pluginName
protected

The name used for this plug-in in the configuration file.

This value is also available using the public getName() method.

Since
10.0

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