1.0.0

org.eclipse.soda.dk.transport.service
Interface TransportService

All Known Subinterfaces:
ConnectionTransportService, DigitalIoTransportService, MulticastTransportService, TunnelTransportService, UdpTransportService
All Known Implementing Classes:
ConnectionTransport, MulticastTransport, ResponseTransport, ThreadTransport, Transport, TunnelTransport, UdpTransport

public interface TransportService

The TransportService interface defines the TransportService concept. A TransportService is the mechanism for sending and receiving messages. A TransportService may be started and stopped, as well as Listened to using the TransportListener Interface.

Version:
1.0.0
See Also:
Transport, ErrorListener, MessageService, ParameterService, TransportListener

Field Summary
static int ACTIVE
          The ACTIVE state is when the transport is attempting to start but is not yet started.
static int ALIVE
          The ALIVE state is when the transport has been told to start.
static java.lang.String CONFIGURATION_DATA_KEY
          Define the configuration data key (String) constant.
static int CONNECTED
          The CONNECTED state is when the tranport is connected to the hardware device.
static java.lang.String CONNECTION_KEY
          Define the connection key (String) constant.
static int CREATED
          The CREATED state is when the transport has been created or stopped.
static int DEAD
          The DEAD state is when the transport has exited and can not be restarted.
static java.lang.String DEFAULT_CONNECTION
          Define the default connection (String) constant.
static java.lang.String ERROR_COUNT_DATA_KEY
          Define the error count data key (String) constant.
static java.lang.String ID_KEY
          Define the id key (String) constant.
static java.lang.String INPUT_MESSAGE_COUNT_DATA_KEY
          Define the input message count data key (String) constant.
static short NULL
          Define the NULL transport style.
static java.lang.String SERVICE_NAME
          Define the OSGi service name.
static java.lang.String SOURCE_DATA_KEY
          Define the source data key (String) constant.
static int STARTED
          The STARTED state is when the transport has started and should be processing messages.
static java.lang.String STATE_DATA_KEY
          Define the state data key (String) constant.
static java.lang.String STATE_OLD_DATA_KEY
          Define the state old data key (String) constant.
static java.lang.String STATUS_EXTERNAL_KEY
          Define the status external key (String) constant.
static java.lang.String TIMESTAMP_DATA_KEY
          Define the timestamp data key (String) constant.
static java.lang.String VALUE_DATA_KEY
          Define the value data key (String) constant.
static java.lang.String VALUE_OLD_DATA_KEY
          Define the value old data key (String) constant.
 
Method Summary
 void addInterest(InterestService interest)
          Add an interest object to the transport.
 void addTransportListener(TransportListener transportListener)
          Adds the specified transport listener to receive listener notification.
 void exit()
          Request the transport to exit.
 java.util.Dictionary getConfigurationInformation()
          Gets the configuration information.
 NotificationService getNotificationService()
          Gets the notification service value.
 int getState()
          Gets the int state property value.
 void removeInterest(InterestService interest)
          Remove an interest object from the transport.
 void removeTransportListener(TransportListener transportListener)
          Removes the specified transport listener from receiving listener notification.
 void send(MessageService message)
          Send the specified message.
 void setConfigurationInformation(java.util.Dictionary configurationInformation)
          Set the configuration information.
 void setNotificationService(NotificationService notificationService)
          Sets the notification service value.
 void start()
          Request the transport to start.
 void stop()
          Request the transport to stop.
 void write(byte[] messageBytes)
          Write the message bytes.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Define the OSGi service name.


ID_KEY

static final java.lang.String ID_KEY
Define the id key (String) constant.

See Also:
Constant Field Values

CONNECTION_KEY

static final java.lang.String CONNECTION_KEY
Define the connection key (String) constant.

See Also:
Constant Field Values

DEFAULT_CONNECTION

static final java.lang.String DEFAULT_CONNECTION
Define the default connection (String) constant.

See Also:
Constant Field Values

NULL

static final short NULL
Define the NULL transport style.

See Also:
Constant Field Values

DEAD

static final int DEAD
The DEAD state is when the transport has exited and can not be restarted.

See Also:
Constant Field Values

CREATED

static final int CREATED
The CREATED state is when the transport has been created or stopped. The transport will not attempt to move to another state until a start request has been issued.

See Also:
Constant Field Values

ALIVE

static final int ALIVE
The ALIVE state is when the transport has been told to start.

See Also:
Constant Field Values

CONNECTED

static final int CONNECTED
The CONNECTED state is when the tranport is connected to the hardware device. This is normally done via a connection service object.

See Also:
Constant Field Values

ACTIVE

static final int ACTIVE
The ACTIVE state is when the transport is attempting to start but is not yet started.

See Also:
Constant Field Values

STARTED

static final int STARTED
The STARTED state is when the transport has started and should be processing messages.

See Also:
Constant Field Values

STATUS_EXTERNAL_KEY

static final java.lang.String STATUS_EXTERNAL_KEY
Define the status external key (String) constant.

See Also:
Constant Field Values

VALUE_DATA_KEY

static final java.lang.String VALUE_DATA_KEY
Define the value data key (String) constant.

See Also:
Constant Field Values

VALUE_OLD_DATA_KEY

static final java.lang.String VALUE_OLD_DATA_KEY
Define the value old data key (String) constant.

See Also:
Constant Field Values

STATE_DATA_KEY

static final java.lang.String STATE_DATA_KEY
Define the state data key (String) constant.

See Also:
Constant Field Values

STATE_OLD_DATA_KEY

static final java.lang.String STATE_OLD_DATA_KEY
Define the state old data key (String) constant.

See Also:
Constant Field Values

TIMESTAMP_DATA_KEY

static final java.lang.String TIMESTAMP_DATA_KEY
Define the timestamp data key (String) constant.

See Also:
Constant Field Values

SOURCE_DATA_KEY

static final java.lang.String SOURCE_DATA_KEY
Define the source data key (String) constant.

See Also:
Constant Field Values

CONFIGURATION_DATA_KEY

static final java.lang.String CONFIGURATION_DATA_KEY
Define the configuration data key (String) constant.

See Also:
Constant Field Values

ERROR_COUNT_DATA_KEY

static final java.lang.String ERROR_COUNT_DATA_KEY
Define the error count data key (String) constant.

See Also:
Constant Field Values

INPUT_MESSAGE_COUNT_DATA_KEY

static final java.lang.String INPUT_MESSAGE_COUNT_DATA_KEY
Define the input message count data key (String) constant.

See Also:
Constant Field Values
Method Detail

addInterest

void addInterest(InterestService interest)
Add an interest object to the transport. The transport will provide notification on messages that pass the interest test. When multiple interests have been added to the transport, message notification will occur to all transport listeners if a message pass any of the interest objects. The interest object to add to the transport.

Parameters:
interest - The interest (InterestService) parameter.
See Also:
removeInterest(InterestService)

addTransportListener

void addTransportListener(TransportListener transportListener)
Adds the specified transport listener to receive listener notification. Implementors of TransportListener may be added as listeners to a TransportService. The TransportListeners will be notified when a valid MessageService is received. The addInterest method can be used to filter message notification. The org.eclipse.soda.dk.transport.service.TransportServiceListener listener to be added.

Parameters:
transportListener - The transport listener (TransportListener) parameter.
See Also:
removeTransportListener(TransportListener)

exit

void exit()
Request the transport to exit. The tranport service will be stopped. It will no longer read Messages or write Messages. All resources will be released. After an exit, the transport service can not be restarted.


getConfigurationInformation

java.util.Dictionary getConfigurationInformation()
Gets the configuration information.

Returns:
Configuration Information.
See Also:
setConfigurationInformation(Dictionary)

getNotificationService

NotificationService getNotificationService()
Gets the notification service value.

Returns:
The notification service (NotificationService) value.
See Also:
setNotificationService(NotificationService)

getState

int getState()
Gets the int state property value. A TransportService may be queried for its current running status.

Returns:
Results of the get state (int) value.

removeInterest

void removeInterest(InterestService interest)
Remove an interest object from the transport. The inrerest object to remove from the transport.

Parameters:
interest - The interest (InterestService) parameter.
See Also:
addInterest(InterestService)

removeTransportListener

void removeTransportListener(TransportListener transportListener)
Removes the specified transport listener from receiving listener notification. The removed transportListener will no longer be notified when a valid MessageService is received. The org.eclipse.soda.dk.transport.service.TransportServiceListener listener to be removed.

Parameters:
transportListener - The transport listener (TransportListener) parameter.
See Also:
addTransportListener(TransportListener)

send

void send(MessageService message)
Send the specified message. A TransportService may send a MessageService when it is started. org.eclipse.soda.dk.message.service.MessageService

Parameters:
message - The message (MessageService) parameter.

setConfigurationInformation

void setConfigurationInformation(java.util.Dictionary configurationInformation)
Set the configuration information. Set the configuration information,

Parameters:
configurationInformation - The configuration information (Dictionary) parameter.
See Also:
getConfigurationInformation()

setNotificationService

void setNotificationService(NotificationService notificationService)
Sets the notification service value. The notification service (NotificationService) parameter. The notification service (NotificationService).

Parameters:
notificationService - The notification service (NotificationService) parameter.
See Also:
getNotificationService()

start

void start()
Request the transport to start. If the transport service is not already started, then the transport will be started and it will now be able to read and write Messages.


stop

void stop()
Request the transport to stop. If no remaining transport service users exist, then the transport will be stopped and it will no longer read Messages or write Messages.


write

void write(byte[] messageBytes)
           throws java.lang.Exception
Write the message bytes. byte[]

Parameters:
messageBytes - The message bytes (byte[]) parameter.
Throws:
java.lang.Exception

1.0.0

Copyright (c) 1999, 2007 IBM