Apama  10.15.0.2
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

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
 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 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

◆ ~Plugin()

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

◆ getName()

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

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

◆ getStatusReporter()

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

◆ hostReady()

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.

◆ shutdown()

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. If the plug-in has any messages queued to send towards the host it should flush them before shutting down. This is not true if the host itself is shutting down (rather than just the chain). This can be determined via the PluginHost::isShuttingDown() method. 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.

◆ start()

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

◆ chainId

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

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

◆ config

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.

◆ host

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

Logger com::softwareag::connectivity::Plugin::logger

Logging for writing to the host log file.

Since
9.12.0.1

◆ pluginName

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: