Apama
10.2.0.3
|
Base class for codec plug-ins. More...
#include <sag_connectivity_plugins.hpp>
Public Member Functions | |
AbstractCodec (const std::string &pluginName, const std::string &chainId, const map_t &config) | |
Legacy constructor [DEPRECATED]. More... | |
AbstractCodec (const PluginConstructorParameters::CodecConstructorParameters ¶ms) | |
Constructor. More... | |
Public Member Functions inherited from com::softwareag::connectivity::Plugin | |
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 Member Functions inherited from com::softwareag::connectivity::HostSide | |
virtual | ~HostSide () |
Ensure virtual destruction. More... | |
virtual void | sendBatchTowardsHost (Message *start, Message *end)=0 |
Abstract method that must be implemented to handle delivery of a batch of messages heading towards the host. More... | |
void | sendBatchTowardsHost (Message &&message) |
Overload for sending a batch containing a single message. More... | |
template<typename IT > | |
auto | sendBatchTowardsHost (const IT &begin, const IT &end) -> typename std::enable_if< !std::is_const< ampl::remove_ref_t< decltype(*begin)>>::value &&l::is_same< Message, ampl::remove_const_t< ampl::remove_ref_t< decltype(*begin)>>>::value, void >::type |
Overload for sending messages using an iterator range. More... | |
Public Member Functions inherited from com::softwareag::connectivity::TransportSide | |
virtual | ~TransportSide () |
Ensure virtual destruction. More... | |
virtual void | sendBatchTowardsTransport (Message *start, Message *end)=0 |
Abstract method that must be implemented to handle delivery of a batch of messages heading towards the transport. More... | |
void | sendBatchTowardsTransport (Message &&message) |
Overload for sending a batch containing a single message. More... | |
template<typename IT > | |
auto | sendBatchTowardsTransport (const IT &begin, const IT &end) -> typename std::enable_if< !std::is_const< ampl::remove_ref_t< decltype(*begin)>>::value &&l::is_same< Message, ampl::remove_const_t< ampl::remove_ref_t< decltype(*begin)>>>::value, void >::type |
Overload for sending messages using an iterator range. More... | |
Protected Attributes | |
HostSide::ptr_t | hostSide |
The next plug-in in the chain towards host. More... | |
TransportSide::ptr_t | transportSide |
The next plug-in in the chain towards transport. More... | |
Protected Attributes inherited from com::softwareag::connectivity::Plugin | |
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... | |
Additional Inherited Members | |
Public Types inherited from com::softwareag::connectivity::HostSide | |
typedef std::unique_ptr< HostSide > | ptr_t |
Pointers to HostSides should always be this ptr_t type, which is a std::unique_ptr. More... | |
Public Types inherited from com::softwareag::connectivity::TransportSide | |
typedef std::unique_ptr < TransportSide > | ptr_t |
Pointers to TransportSides should always be this ptr_t type, which is a std::unique_ptr. More... | |
Public Attributes inherited from com::softwareag::connectivity::Plugin | |
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 inherited from com::softwareag::connectivity::Plugin | |
StatusReporter & | getStatusReporter () |
Allows reporting status information from this plug-in, such as online or failed status and number of messages sent/received in each direction. More... | |
Base class for codec plug-ins.
Implementors may derive directly from this class, providing an implementation of its abstract methods to provide any required transformation of Message objects as they are sent towards the transport or host side. For many codecs, inheriting from AbstractSimpleCodec may be more convenient than using this class directly, as it deals with batching of messages and ignoring messages with null payloads.
To export a codec class for use in the host you should use the SAG_DECLARE_CONNECTIVITY_CODEC_CLASS(Class) macro, and provide a public constructor with the same signature as AbstractCodec(const PluginConstructorParameters::CodecConstructorParameters &).
The deprecated legacy constructor AbstractCodec(const std::string &name, const std::string &chainId, const map_t &config) and SAG_DECLARE_CONNECTIVITY_CODEC(Class) macro are still permitted as an alternative but should not be used for new plug-ins.
MapHelper can be used to extract the content of the message.
Derives from Plugin, which provides Plugin::pluginName, Plugin::chainId, Plugin::config and Plugin::logger members. Derives from HostSide, requiring derived classes to implement sendBatchTowardsHost(Message*, Message*) Derives from TransportSide, requiring derived classes to implement sendBatchTowardsTransport(Message*, Message*)
|
inline |
Legacy constructor [DEPRECATED].
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.
pluginName | The name used in the configuration file for this plug-in. |
chainId | The identifier used for the chain this plug-in is part of. |
config | The configuration for this plug-in. |
|
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.
params | Provides access to the configuration for this plug-in, and other capabilities. |
|
protected |
The next plug-in in the chain towards host.
This field will be given a valid value before the start() method is called.
|
protected |
The next plug-in in the chain towards transport.
This field will be given a valid value before the start() method is called.