Apama
10.0.0.2
|
Base of the inheritance tree for Connectivity plugins. More...
#include <sag_connectivity_plugins.hpp>
Public Member Functions | |
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 |
Return the name of this plugin instance. 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 | |
StatusReporter & | getStatusReporter () |
Allows reporting status information from this plug-in, such as connected/disconnected 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 [DEPRECATED]. 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... | |
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.
|
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.
|
inline |
Return the name of this plugin instance.
|
inlineprotected |
Allows reporting status information from this plug-in, such as connected/disconnected status and number of messages sent/received in each direction.
Cannot be used with plug-ins that use the legacy constructor.
|
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.
|
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.
|
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.
|
protected |
The identifier used for the chain this plug-in is part of.
|
protected |
The configuration of this plug-in.
The plug-in owns and is free to mutate this data structure.
|
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].
Logger com::softwareag::connectivity::Plugin::logger |
Logging for writing to the host log file.
|
protected |
The name used for this plug-in in the configuration file [DEPRECATED].
|
protected |
The name used for this plug-in in the configuration file.