Class AbstractSimpleTransport
java.lang.Object
com.softwareag.connectivity.ConnectivityPlugin
com.softwareag.connectivity.AbstractTransport
com.softwareag.connectivity.AbstractSimpleTransport
- All Implemented Interfaces:
TransportSide
Base class that allows simplified implementation of transport plug-ins.
Handles batches of messages and ignoring null payload messages (by
default). Plug-in authors will typically extend this class,
providing a valid constructor, an implementation of
deliverMessageTowardsTransport(Message),
and calling HostSide.sendBatchTowardsHost(List) to send messages in the other direction.
Subclasses should provide a constructor with the same signature as
AbstractSimpleTransport(org.slf4j.Logger, PluginConstructorParameters.TransportConstructorParameters).
-
Field Summary
Fields inherited from class AbstractTransport
hostSideFields inherited from class ConnectivityPlugin
chainId, config, CONNECTIVITY_API_VERSION, host, logger, pluginName -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSimpleTransport(org.slf4j.Logger logger, PluginConstructorParameters.TransportConstructorParameters params) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddeliverMessageTowardsTransport(Message message) Deliver an individual non-null message.voidDeliver an individual null-payload message.voidhandleException(Exception ex, Message message, boolean towardsTransport) Handle exception thrown from delivering messages.voidsendBatchTowardsTransport(List<Message> messages) Deliver a batch of messages and pass them on to the next plug-in synchronously.Methods inherited from class AbstractTransport
hostReady, setNextTowardsHost, shutdown, start, toStringMethods inherited from class ConnectivityPlugin
getStatusReporter
-
Constructor Details
-
AbstractSimpleTransport
public AbstractSimpleTransport(org.slf4j.Logger logger, PluginConstructorParameters.TransportConstructorParameters params) throws IllegalArgumentException, Exception Constructor. A subclass should provide its own constructor with the same signature as this one. This base class makes the parameters passed into its constructor available as member fields or methods for use by the subclass.- Parameters:
logger- a slf4j Logger object which can be used to log to the host log file.params- an extensible interface providing access to the configuration for this plug-in and other capabilities.- Throws:
IllegalArgumentException- should be thrown from a plug-in's constructor if the configuration is invalid.Exception- can be thrown to indicate an internal error.- Since:
- 9.12.0.1
-
-
Method Details
-
sendBatchTowardsTransport
Deliver a batch of messages and pass them on to the next plug-in synchronously. For each message passed in, calls deliverMessageTowardsTransport or deliverNullPayloadTowardsTransport (if the payload was null). On an exception, call handleException.If the transport can deliver multiple events in a batch more efficiently, then it should override this method.
-
deliverMessageTowardsTransport
-
deliverNullPayloadTowardsTransport
Deliver an individual null-payload message. By convention, most plug-ins silently ignore messages with null payloads without delivering them. Thus, the default implementation of this method is a no-op.- Throws:
Exception
-
handleException
-