public abstract class ConnectivityPlugin
extends java.lang.Object
AbstractCodec
,
AbstractTransport
Modifier and Type | Field and Description |
---|---|
java.lang.String |
chainId
The identifier used for the chain this plug-in is part of.
|
java.util.Map<java.lang.String,java.lang.Object> |
config
Configuration of this plug-in.
|
static java.lang.String |
CONNECTIVITY_API_VERSION
A string constant containing the 4-digit version number for this API.
|
PluginHost |
host
Interface to support miscellaneous requests from this plug-in to the host system.
|
org.slf4j.Logger |
logger
A slf4j logger to be used by this plug-in instance for anything which needs
to be written to the host's log.
|
java.lang.String |
pluginName
The name used in the configuration file for this plug-in.
|
Modifier and Type | Method and Description |
---|---|
StatusReporter |
getStatusReporter()
Allows reporting status information from this plug-in, such as connected/disconnected
status and number of messages sent/received in each direction.
|
abstract void |
hostReady()
Called some time after
start() , 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.
|
public static final java.lang.String CONNECTIVITY_API_VERSION
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;
public final org.slf4j.Logger logger
public final java.util.Map<java.lang.String,java.lang.Object> config
public final java.lang.String chainId
public final java.lang.String pluginName
public final PluginHost host
Cannot be used with plug-ins that use the legacy constructor.
public abstract void start() throws java.lang.Exception
java.lang.Exception
- only if a fatal error occurred during startup.public abstract void shutdown() throws java.lang.Exception
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.
java.lang.Exception
public abstract void hostReady() throws java.lang.Exception
start()
, 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.java.lang.Exception
public StatusReporter getStatusReporter()
Cannot be used with plug-ins that use the legacy constructor.
Submit a bug or feature
Copyright (c) 2013-2020 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.