1.0.0

org.eclipse.soda.dk.transport
Class TunnelTransport

java.lang.Object
  extended by org.eclipse.soda.dk.core.EscObject
      extended by org.eclipse.soda.dk.transport.Transport
          extended by org.eclipse.soda.dk.transport.TunnelTransport
All Implemented Interfaces:
ConfigurationService, ErrorListener, MessageListener, TransportListener, TransportService, TunnelTransportService

public class TunnelTransport
extends Transport
implements TunnelTransportService, TransportListener

The TunnelTransport class implements the TransportService interface.

Version:
1.0.0
See Also:
Message, EscObject, Transport, ErrorListener, TransportService, TransportListener

Field Summary
 
Fields inherited from class org.eclipse.soda.dk.transport.Transport
BAD_CHECKSUM_RESOURCE, CLONE_EXCEPTION_RESOURCE, CLOSE_EXCEPTION_RESOURCE, CONFIGURATION_ERROR_RESOURCE, CONFIGURATION_MISMATCH_RESOURCE, CONNECTION_IN_USE_EXCEPTION_RESOURCE, CR, DEFAULT_NO_ACTIVITY_TIMEOUT, DEFAULT_RETRY_TIME, ERROR_OCCURRED_EXCEPTION_RESOURCE, ERROR_ON_BUS_RESOURCE, errorCount, EXCEPTION_NO_RESPONSE_RESOURCE, inputMessageCount, INTERRUPT_BEFORE_WRITE_RESOURCE, INVALID_MESSAGE_RESOURCE, INVALID_SEQUENCE_RESOURCE, LF, MESSAGE_FILTERED_RESOURCE, MESSAGE_RECEIVED_EXCEPTION_RESOURCE, MESSAGE_RECEIVED_RESOURCE, MESSAGE_SENT_RESOURCE, NACK_RECEIVED_RESOURCE, NO_ACTIVITY_RESOURCE, noActivityTimeout, notificationService, PROCESS_INPUT_EXCEPTION_RESOURCE, QUEUE_TOO_BIG_RESOURCE, RECONNECT_RESOURCE, retryTime, RUN_EXCEPTION_RESOURCE, SEND_EXCEPTION_RESOURCE, SEND_NOT_STARTED_EXCEPTION_RESOURCE, sentMessageCount, SHUTDOWN_EXCEPTION_RESOURCE, STARTUP_EXCEPTION_RESOURCE, STARTUP_MESSAGE_RECEIVED_RESOURCE, STATE_STRINGS, stateChanaged, TRANSPORT_ACTIVE_STATE_RESOURCE, TRANSPORT_ALIVE_STATE_RESOURCE, TRANSPORT_CHANGED_EXCEPTION_RESOURCE, TRANSPORT_CONNECTED_STATE_RESOURCE, TRANSPORT_CREATED_STATE_RESOURCE, TRANSPORT_DEAD_STATE_RESOURCE, TRANSPORT_ERROR_RESOURCE, TRANSPORT_STARTED_STATE_RESOURCE, TRANSPORT_STARTUP_EXCEPTION_RESOURCE, TRANSPORT_STATE_RESOURCE_TABLE, UNABLE_TO_CONNECTION_TO_BUS_RESOURCE, UNKNOWN_ERROR, WRITE_EXCEPTION_RESOURCE, WRITE_INTERRUPT_PENDING_RESOURCE, WRITE_INTERRUPT_RESOURCE
 
Fields inherited from class org.eclipse.soda.dk.core.EscObject
EMPTY_BYTES, EMPTY_STRING, ID_FILTER_KEY, ID_KEY, ID_KEY_ANY, INTEGER_TABLE, KEY_KEY, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_TRACE, LOG_WARNING, PREFIX_KEY, RESOURCE_BUNDLE, SLEEP_EXCEPTION_RESOURCE, SYSTEM_INFO_RESOURCE, TO_STRING_CONFIGURATION_KEYS, TRACE_LEVEL_HIGH, TRACE_LEVEL_LOW, TRACE_LEVEL_MAX, TRACE_LEVEL_MIN, TRACE_LEVEL_NONE, TRACE_LEVEL_NORMAL, TRACELEVEL_KEY, UNKNOWN_ERROR_RESOURCE
 
Fields inherited from interface org.eclipse.soda.dk.transport.service.TransportService
ACTIVE, ALIVE, CONFIGURATION_DATA_KEY, CONNECTED, CONNECTION_KEY, CREATED, DEAD, DEFAULT_CONNECTION, ERROR_COUNT_DATA_KEY, ID_KEY, INPUT_MESSAGE_COUNT_DATA_KEY, NULL, SERVICE_NAME, SOURCE_DATA_KEY, STARTED, STATE_DATA_KEY, STATE_OLD_DATA_KEY, STATUS_EXTERNAL_KEY, TIMESTAMP_DATA_KEY, VALUE_DATA_KEY, VALUE_OLD_DATA_KEY
 
Constructor Summary
TunnelTransport(TransportService transport, short style)
          Constructs an TunnelTransport object using the input parameter(s).
 
Method Summary
 void errorOccurred(java.lang.Object source, java.lang.Object timestamp, java.lang.Object data)
          The errorOccurred method is called when an error has occurred.
 void fireTransportChanged(TransportService source, java.lang.Object timestamp, int newState, int oldState)
          This method will be called when the state of the TransportService changes to notify listeners of the changes.
 int getCombinedState()
          Gets the combined state (int) value.
 TransportService getTransport()
          Returns the target transport.
 void getTransport(TransportService transport)
          Get transport with the specified transport parameter.
 boolean isActive()
          Return true if the transport is active.
 void messageReceived(TransportService transportService, java.lang.Object timestamp, MessageService message)
          This API will be called each time the TransportService receives a valid message.
 void register(TransportService transport)
          Register the target transport.
 void setTransport(TransportService transport)
          Sets the transport property.
 void start()
          Start the transport.
 void stop()
          Stop the transport.
 void transportChanged(TransportService transportService, java.lang.Object timestamp, int newState, int oldState)
          This method will be called when the state of the TransportService changes.
 void unregister(TransportService transport)
          Unregister the target transport.
 void write(byte[] bytes)
          Write bytes to the target transport.
protected  void write(MessageService message)
          Write method will send the message to the target transport.
 
Methods inherited from class org.eclipse.soda.dk.transport.Transport
addInterest, addTransportListener, attemptRecoveryFromError, broadcastStatus, close, configure, connect, createController, exit, finalize, fireErrorOccurred, fireMessageReceived, getConfigurationInformation, getConfigurationInformation, getConfigurationService, getConnection, getController, getErrorCount, getErrorSeverity, getInformation, getInputMessageCount, getInterestMask, getKey, getLogDetails4, getLogDetails5, getNoActivityTimeout, getNotificationPriority, getNotificationService, getPriority, getProperties, getQualifiedKey, getResource, getRetryTime, getSentMessageCount, getState, getString, getStyle, getTransportListener, handleError, hasListeners, isEcho, isReceivingData, isReceivingGoodData, isReceivingInput, isStarted, log, noActivityProcessing, noActivityProcessingMessage, putConfigurationInformation, read, removeInterest, removeTransportListener, restart, restartProcessing, send, send, setActive, setConfigurationInformation, setController, setEcho, setErrorCount, setInformation, setInputMessageCount, setInterestMask, setNoActivityTimeout, setNotificationService, setReceivingData, setReceivingData, setReceivingGoodData, setReceivingGoodData, setReceivingInput, setReceivingInput, setRetryTime, setSentMessageCount, setState, setStyle, setTransportListener, setup, setupCustom, shutdown, start, startup, startupMessageReceived, toString, updateErrorCount, updateInputMessageCount, updateSentMessageCount, waitStateChange, waitStateChange, writeAndReport, writeAndReport
 
Methods inherited from class org.eclipse.soda.dk.core.EscObject
createDefaultLogService, createException, createException, createInteger, createIntegerTable, createNumber, format, getBoolean, getCurrentTimestamp, getDefaultLogService, getDefaultResource, getFloat, getInt, getLoadLibraryName, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails6, getLogDetails7, getLogService, getLong, getObject, getOutputName, getSimpleClassName, getStaticBoolean, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleStaticError, handleStaticException, isDebug, isTrace, loadService, log, report, report, report, report, report, report, reportError, reportSystemInfo, setDebug, setDefaultLogService, setLogService, setTraceLevel, shouldLog, sleep, startupEscStatic, toStringConfigurationKeys, toStringInfo
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.soda.dk.transport.service.TransportService
addInterest, addTransportListener, exit, getConfigurationInformation, getNotificationService, getState, removeInterest, removeTransportListener, send, setConfigurationInformation, setNotificationService
 
Methods inherited from interface org.eclipse.soda.dk.core.service.ConfigurationService
getBoolean, getFloat, getInt, getLong, getObject
 

Constructor Detail

TunnelTransport

public TunnelTransport(TransportService transport,
                       short style)
Constructs an TunnelTransport object using the input parameter(s). org.eclipse.soda.dk.transport.service.TransportService The style (short) parameter.

Parameters:
transport - The transport (TransportService) parameter.
style - The style (short) parameter.
Method Detail

errorOccurred

public void errorOccurred(java.lang.Object source,
                          java.lang.Object timestamp,
                          java.lang.Object data)
The errorOccurred method is called when an error has occurred. Since other notifications are blocked until this method returns, implementors of this method should: The source object that detected the error. The time at which the error was detected. Contains any data about the error.

Specified by:
errorOccurred in interface ErrorListener
Parameters:
source - The source (Object) parameter.
timestamp - The timestamp (Object) parameter.
data - The data (Object) parameter.

fireTransportChanged

public void fireTransportChanged(TransportService source,
                                 java.lang.Object timestamp,
                                 int newState,
                                 int oldState)
Description copied from class: Transport
This method will be called when the state of the TransportService changes to notify listeners of the changes. org.eclipse.soda.dk.transport.service.TransportService java.lang.Object The new state of the TransportService. The old state of the TransportService.

Overrides:
fireTransportChanged in class Transport
Parameters:
source - The source (TransportService) parameter.
timestamp - The timestamp (Object) parameter.
newState - The new state (int) parameter.
oldState - The old state (int) parameter.
See Also:
The source (TransportService) parameter. The timestamp (Object) parameter. The new state (int) parameter. The old state (int) parameter.

getCombinedState

public int getCombinedState()
Gets the combined state (int) value.

Returns:
The combined state (int) value.

getTransport

public TransportService getTransport()
Returns the target transport.

Specified by:
getTransport in interface TunnelTransportService
Returns:
Results of the get transport (TransportService) value.
See Also:
TunnelTransport(TransportService,short), getTransport(TransportService), setTransport(TransportService)

getTransport

public void getTransport(TransportService transport)
Get transport with the specified transport parameter. The transport (TransportService) parameter.

Parameters:
transport - The transport (TransportService) parameter.
See Also:
TunnelTransport(TransportService,short), getTransport(), setTransport(TransportService)

isActive

public boolean isActive()
Return true if the transport is active.

Overrides:
isActive in class Transport
Returns:
Results of the is active (boolean) value.
See Also:
Transport.setActive(boolean)

messageReceived

public void messageReceived(TransportService transportService,
                            java.lang.Object timestamp,
                            MessageService message)
This API will be called each time the TransportService receives a valid message. Since other notifications are blocked until this method returns, implementors of this method should: The transport that received the message. The timestamp when the message was detected. The message received.

Specified by:
messageReceived in interface MessageListener
Parameters:
transportService - The transport service (TransportService) parameter.
timestamp - The timestamp (Object) parameter.
message - The message (MessageService) parameter.

register

public void register(TransportService transport)
Register the target transport. The transport (TransportService) parameter.

Parameters:
transport - The transport (TransportService) parameter.

setTransport

public void setTransport(TransportService transport)
Sets the transport property. The new property value (org.eclipse.soda.dk.transport.service.TransportService).

Specified by:
setTransport in interface TunnelTransportService
Parameters:
transport - The transport (TransportService) parameter.
See Also:
TunnelTransport(TransportService,short), getTransport(), getTransport(TransportService)

start

public void start()
Start the transport.

Specified by:
start in interface TransportService
Overrides:
start in class Transport
See Also:
TransportService.start()

stop

public void stop()
Stop the transport.

Specified by:
stop in interface TransportService
Overrides:
stop in class Transport
See Also:
TransportService.stop()

transportChanged

public void transportChanged(TransportService transportService,
                             java.lang.Object timestamp,
                             int newState,
                             int oldState)
This method will be called when the state of the TransportService changes. Since other notifications are blocked until this method returns, implementors of this method should: Because of the multiple threads and quickly changing states, the current state of the transport may not be the same as the newState input parameter. org.eclipse.soda.dk.transport.service.TransportService java.lang.Object The new state of the TransportService when the notification process started. The old state of the TransportService.

Specified by:
transportChanged in interface TransportListener
Parameters:
transportService - The transport service (TransportService) parameter.
timestamp - The timestamp (Object) parameter.
newState - The new state (int) parameter.
oldState - The old state (int) parameter.
See Also:
fireTransportChanged(TransportService,Object,int,int)

unregister

public void unregister(TransportService transport)
Unregister the target transport. The transport (TransportService) parameter.

Parameters:
transport - The transport (TransportService) parameter.

write

public void write(byte[] bytes)
           throws java.lang.Exception
Write bytes to the target transport.

Specified by:
write in interface TransportService
Overrides:
write in class Transport
Parameters:
bytes - The bytes (byte[]) parameter.
Throws:
java.lang.Exception
See Also:
The bytes (byte[]) parameter., write(MessageService)

write

protected void write(MessageService message)
              throws java.lang.Exception
Write method will send the message to the target transport.

Overrides:
write in class Transport
Parameters:
message - The message (MessageService) parameter.
Throws:
java.lang.Exception
See Also:
The message (MessageService) parameter., write(byte[])

1.0.0

Copyright (c) 1999, 2007 IBM