|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.apama.iaf.plugin.AbstractEventTransport
public abstract class AbstractEventTransport
AbstractEventTransport is the abstract base class which all Java IAF event transports should extend. It includes the EventTransport interface the IAF uses to tell the transport to send an upstream event, and also contains abstract definitions of the other methods the IAF will need to call (via a JNI interface to libraries written in C)
In addition to implementing the abstract methods here and in the EventTransport interface, valid subclasses must provide a constructor with the same signature as the one provided here. Note that the IAF provides NO guarantees about what threads that will be used to call these functions, so to ensure correct operation care must be taken to use locking where required.
Field Summary |
---|
Fields inherited from interface com.apama.iaf.plugin.EventTransport |
---|
API_VERSION |
Constructor Summary | |
---|---|
AbstractEventTransport(java.lang.String name,
EventTransportProperty[] properties,
TimestampConfig timestampConfig)
Construct a new instance of AbstractEventTransport. |
Method Summary | |
---|---|
abstract void |
addEventDecoder(java.lang.String name,
EventDecoder decoder)
Add a named event decoder to the set of decoders known to the transport. |
abstract void |
cleanup()
Frees any resources allocated by the transport (useful for resources external to the JVM that were allocated in the constructor). |
void |
flushDownstream()
Flush any pending transport events into the decoder. |
void |
flushUpstream()
Flush any pending normalized events onto the external transport. |
abstract int |
getAPIVersion()
Return the transport API version that the transport was built against. |
int |
getCapabilities()
Return the capabilities of the transport. |
abstract TransportStatus |
getStatus()
Return a TransportStatus or ExtendedTransportStatus
object containing up-to-date status information for the transport. |
abstract void |
removeEventDecoder(java.lang.String name)
Remove a named event decoder from the set of decoders known to the transport. |
abstract void |
sendTransportEvent(java.lang.Object event,
TimestampSet timestamps)
Called by an event encoder to send an upstream message to the external transport. |
abstract void |
start()
Establish a connection and start processing incoming data from the external transport. |
abstract void |
stop()
Stop processing incoming data from the external transport, typically by pausing or closing down connections. |
java.lang.String |
toString()
|
void |
updateProperties(EventTransportProperty[] properties,
TimestampConfig timestampConfig)
Update the configuration of the transport. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractEventTransport(java.lang.String name, EventTransportProperty[] properties, TimestampConfig timestampConfig) throws TransportException
The AbstractEventTransport implementation does nothing, but subclasses should make use of the arguments to initialize the transport.
name
- The transport name, as specified in the IAF config fileproperties
- The transport property set specified in the IAF
configuration filetimestampConfig
- Timestamp recording/logging settings from the
IAF configuration file
TransportException
Method Detail |
---|
public void updateProperties(EventTransportProperty[] properties, TimestampConfig timestampConfig) throws TransportException
properties
- The new transport property set specified in the IAF
configuration filetimestampConfig
- Timestamp recording/logging settings
TransportException
public abstract void addEventDecoder(java.lang.String name, EventDecoder decoder) throws TransportException
name
- The name of the decoder to be addeddecoder
- The decoder object instance
TransportException
public abstract void removeEventDecoder(java.lang.String name) throws TransportException
name
- The decoder to be removed
TransportException
public void flushUpstream() throws TransportException
TransportException
public void flushDownstream() throws TransportException
TransportException
public abstract void start() throws TransportException
An adapter should send events to the correlator only after its start() method is called and before the stop() method returns. Therefore we strongly recommend that a transport should not change to a state where it is possible to receive events from any external transport until the start() method has been called. In many cases, adapters will also need to communicate with service monitors in the correlator to ensure that the required monitors and event definitions are injected before they begin to process messages from the external system. This is necessary in order to avoid events from the adapter being lost if the correlator is not yet ready to parse and process them.
TransportException
public abstract void stop() throws TransportException
Adapter authors must ensure that no events are sent to the Correlator after stop() has returned (the only exception being rare cases where the transport sends buffered events in the Correlator in the flushDownstream() method, which is called by the IAF after stop()). If necessary any messages that are unavoidably received from the transport after stop() has returned should be blocked, queued or simply dropped.
TransportException
public abstract void cleanup() throws TransportException
TransportException
public abstract TransportStatus getStatus()
TransportStatus
or ExtendedTransportStatus
object containing up-to-date status information for the transport.
public abstract int getAPIVersion()
EventTransport.API_VERSION
.public int getCapabilities()
0
.public java.lang.String toString()
toString
in class java.lang.Object
public abstract void sendTransportEvent(java.lang.Object event, TimestampSet timestamps) throws TransportException
EventTransport
It is assumed that the encoder and transport share the same definition of the content of the event, so that the transport can effectively interpret the event.
sendTransportEvent
in interface EventTransport
event
- An object representing the event to be sent by the
transport, in a format shared by the encoder and transport.timestamps
- A TimestampSet representing the timestamps attached
to the event.
TransportException
- Thrown by the transport if any error occurs
sending the message.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |