Class ConnectivityPlugin
- Direct Known Subclasses:
AbstractCodec
,AbstractTransport
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal String
The identifier used for the chain this plug-in is part of.Configuration of this plug-in.static final String
A string constant containing the 4-digit version number for this API.final PluginHost
Interface to support miscellaneous requests from this plug-in to the host system.final org.slf4j.Logger
A slf4j logger to be used by this plug-in instance for anything which needs to be written to the host's log.final String
The name used in the configuration file for this plug-in. -
Method Summary
Modifier and TypeMethodDescriptionAllows reporting status information from this plug-in, such as connected/disconnected status and number of messages sent/received in each direction.abstract void
Called some time afterstart()
, when the host is ready to start receiving messages.abstract void
shutdown()
Close any resources created by the connectivity plug-in, and terminate and join any background threads.abstract void
start()
Called when an entire chain has been created.
-
Field Details
-
CONNECTIVITY_API_VERSION
A string constant containing the 4-digit version number for this API.Plug-ins should publish the API version they were compiled against by defining a public static final String constant called CONNECTIVITY_API_VERSION set to the value of this constant, e.g.
public static final String CONNECTIVITY_API_VERSION = com.softwareag.connectivity.ConnectivityPlugin.CONNECTIVITY_API_VERSION;
- Since:
- 10.0.0
- See Also:
-
logger
public final org.slf4j.Logger loggerA slf4j logger to be used by this plug-in instance for anything which needs to be written to the host's log. The host will take care of adding the plug-in and chain name to the messages logged using this object.- Since:
- 9.12.0.1
-
config
Configuration of this plug-in. As passed into the constructor. -
chainId
The identifier used for the chain this plug-in is part of. -
pluginName
The name used in the configuration file for this plug-in.- Since:
- 9.12.0.1
-
host
Interface to support miscellaneous requests from this plug-in to the host system.Cannot be used with plug-ins that use the legacy constructor.
- Since:
- 10.0
-
-
Method Details
-
start
Called when an entire chain has been created. The start method will never be called more than once on this instance.- Throws:
Exception
- only if a fatal error occurred during startup.
-
shutdown
Close any resources created by the connectivity plug-in, and terminate and join any background threads.The host will call this during host shutdown or when the chain is being destroyed dynamically for any other reason.
Implementations should also ensure they work correctly even if the start() method was not called (it is especially important to consider this case when implementing transports with an associated chain manager), since if any plug-in in the chain fails to start, shutdown() will be called on all the other plug-ins to ensure an orderly cleanup of any references and/or resources.
This method will never be called more than once on this instance.
This method may be called while messages are still being delivered towards the host or towards the transport. If the plug-in is blocked waiting to send a message it should attempt to cancel the operation when this method is called (any messages should be discarded once shutdown has been called), and if possible should avoid returning from this method until all outstanding operations and threads have completed.
- Throws:
Exception
-
hostReady
Called some time afterstart()
, when the host is ready to start receiving messages. The host will not process messages from the plug-in until this occurs. This is advisory: the plug-in is permitted to send messages before this is called, but may opt to queue the messages until it is ready to process messages. Plug-ins may choose to not receive messages from a third party until the host is ready for them.- Throws:
Exception
-
getStatusReporter
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.
- Since:
- 10.0
-