org.openadaptor.adaptor.transporter
Interface Control

All Known Subinterfaces:
Transporter
All Known Implementing Classes:
AbstractTransporter, JMSAdaptorListener, JMSAdaptorPublisher, JMSDrainListener, JMSListener, JMSPeeker, JMSPublisher, JMSStringPublisher, JMSTransporter

public interface Control


Method Summary
 void closeTransporter(java.lang.String duringException)
          Closes the connection to the underlying transport.
 java.lang.String getConnectionFailedException()
          getConnectionFailedException() should be checked by isConnectionAlive() before any attempt to "ping" the server, and if the result is non-null the connection may be assumed to be dead, with the string value containing a description of the reason, if any, for the failure.
 boolean isConnectionAlive()
          Check whether the connection is alive (and is not closing) or has failed.
 boolean isConnectionClosing()
          Returns true if a connection is being closed
 boolean isPaused()
          Returns true after pauseTransporter() has been called.
 boolean isRunning()
          Check if the transporter is running and trying to process messages.
 boolean isStopping()
          Check if the transporter is trying to stop.
 void pauseTransporter()
          Pause reception of messages.
 void resumeTransporter()
          Resume reception of messages after a pause.
 void setConnectionFailedException(java.lang.String exception)
          Use setConnectionFailedException() to notify connection failures.
 void startTransporter()
          Start listening for, or sending, messages.
 void stopTransporter()
          Stop listening for messages.
 

Method Detail

startTransporter

void startTransporter()
                      throws IbafException
Start listening for, or sending, messages. Establishes underlying connection if not already connected. If the transporter is already running, this call does not change its status.

Throws:
IbafException

stopTransporter

void stopTransporter()
                     throws IbafException
Stop listening for messages.

Throws:
IbafException

pauseTransporter

void pauseTransporter()
                      throws IbafException
Pause reception of messages.

Temporarily stops the transporter's delivery of incoming messages. It can be restarted using the resumeTransporter() method.

The underlying connection may continue to deliver some "in-flight" messages before the pause takes effect.

Throws:
IbafException - If problem pausing the transporter

resumeTransporter

void resumeTransporter()
                       throws IbafException
Resume reception of messages after a pause.

Throws:
IbafException - If problem resuming the transporter

closeTransporter

void closeTransporter(java.lang.String duringException)
                      throws IbafException
Closes the connection to the underlying transport.

Parameters:
duringException - Set non-null if closeTransporter() called as a result of exception handling. If any exceptions occur during the close operation, the value is appended to the error message.
Throws:
IbafException - If problem resuming the transporter

isPaused

boolean isPaused()
Returns true after pauseTransporter() has been called. Returns false after resumeTransporter() has been called.

This return value of this method used in situations where the underlying transport has no explicit means of pausing a particular connection. If it returns true, the transporter should continue to run, but not process messages.


isConnectionAlive

boolean isConnectionAlive()
Check whether the connection is alive (and is not closing) or has failed.


isConnectionClosing

boolean isConnectionClosing()
Returns true if a connection is being closed


isRunning

boolean isRunning()
Check if the transporter is running and trying to process messages.


isStopping

boolean isStopping()
Check if the transporter is trying to stop.


setConnectionFailedException

void setConnectionFailedException(java.lang.String exception)
                                  throws IbafException
Use setConnectionFailedException() to notify connection failures. The notification can be out-of-band or asychronous.

Throws:
IbafException

getConnectionFailedException

java.lang.String getConnectionFailedException()
getConnectionFailedException() should be checked by isConnectionAlive() before any attempt to "ping" the server, and if the result is non-null the connection may be assumed to be dead, with the string value containing a description of the reason, if any, for the failure.

AbstractTransporter.setConnectionFailedException(String exception) should therefore be called with a null value when a fresh live connection is established.