2008-02-07 1.1.0

org.eclipse.soda.dk.transport
Class ResponseTransport

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.ThreadTransport
              extended by org.eclipse.soda.dk.transport.ConnectionTransport
                  extended by org.eclipse.soda.dk.transport.ResponseTransport
All Implemented Interfaces:
java.lang.Runnable, ConfigurationService, ConnectionTransportService, TransportService

public abstract class ResponseTransport
extends ConnectionTransport

The ResponseTransport class implements the TransportService interface.

Version:
1.1.0
See Also:
ConnectionTransport, Message, EscObject, ThreadTransport, Transport, Runnable, String, TransportService

Field Summary
protected  java.lang.Object readBlock
          Define the read block (Object) field.
protected  MessageService sentMessage
          Define the sent message (MessageService) field.
protected  java.lang.Object writeBlock
          Define the write block (Object) field.
 
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, history, 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, prefixMetrics, prefixStatus, 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, stateChangeCount, 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, INTEGER_TABLE_SIZE, 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, METRICS_EXTERNAL_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
protected ResponseTransport()
          Constructs an ResponseTransport object.
 
Method Summary
 void fireMessageReceived(java.lang.Object timestamp, MessageService message)
          Perform the fireMessageReceived action method.
 void fireMessageReceivedNoResponse(java.lang.Object timestamp, MessageService message)
           
 long getDefaultResponseTimeout()
          Gets the long defaultResponseTimeout property value.
protected  byte[] getLastWriteBytes()
          Gets the byte[] last bytes written.
 long getResponseMessageCount()
          Gets the response message count (long) value.
 long getResponseTimeout()
          Gets the long responseTimeout property value.
 MessageService getSentMessage()
          Gets the sent message (MessageService) value.
 long getShutdownTimeout()
          Gets the shutdown timeout (long) value.
 void responseReceived()
          Response received.
protected  void setLastWriteBytes(byte[] lastWriteBytes)
           
 void setResponseMessageCount(long responseMessageCount)
           
 void setResponseTimeout(long responseTimeout)
          Sets the responseTimeout property.
 void setSentMessage(MessageService sentMessage)
           
 void setup()
          Setup the transport.
 long updateResponseMessageCount()
          Update response message count and return the long result.
 void write(byte[] sendBytes)
          Perform the send action method.
protected  void write(byte[] bytes, long responseTimeout)
           
protected  void write(MessageService message)
          Write (send) the specified message after converting the message to the correct set of bytes to be written.
protected  void writeRaw(byte[] sendBytes)
          Write raw with the specified send bytes parameter.
 
Methods inherited from class org.eclipse.soda.dk.transport.ConnectionTransport
close, connect, exit, getConnection, getDefaultConnection, read, setConnection
 
Methods inherited from class org.eclipse.soda.dk.transport.ThreadTransport
getBufferSize, getThread, handleNoData, handleNoInput, isRunning, processInput, processInput, processInput, run, setRunning, setThread, shutdown, start, stop
 
Methods inherited from class org.eclipse.soda.dk.transport.Transport
addHistory, addInterest, addTransportListener, attemptRecoveryFromError, broadcastMetrics, broadcastStatus, configure, createController, finalize, fireErrorOccurred, fireTransportChanged, getConfigurationInformation, getConfigurationInformation, getConfigurationService, getController, getErrorCount, getErrorSeverity, getHistory, getInformation, getInputMessageCount, getInterestMask, getKey, getLogDetails4, getLogDetails5, getNoActivityTimeout, getNotificationPriority, getNotificationService, getPrefix, getPriority, getProperties, getQualifiedKey, getResource, getRetryTime, getSentMessageCount, getState, getStateChangeCount, getString, getStyle, getTransportListener, handleError, hasListeners, isActive, isEcho, isReceivingData, isReceivingGoodData, isReceivingInput, isStarted, log, noActivityProcessing, noActivityProcessingMessage, prependPrefix, prependPrefix, putConfigurationInformation, removeInterest, removeTransportListener, restart, restartProcessing, send, send, setActive, setConfigurationInformation, setController, setEcho, setErrorCount, setHistory, setInformation, setInputMessageCount, setInterestMask, setNoActivityTimeout, setNotificationService, setReceivingData, setReceivingData, setReceivingGoodData, setReceivingGoodData, setReceivingInput, setReceivingInput, setRetryTime, setSentMessageCount, setState, setStateChangeCount, setStyle, setTransportListener, setupCustom, 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, handleErrorInternal, 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, getConfigurationInformation, getNotificationService, getState, removeInterest, removeTransportListener, send, setConfigurationInformation, setNotificationService, start, stop
 
Methods inherited from interface org.eclipse.soda.dk.core.service.ConfigurationService
getBoolean, getFloat, getInt, getLong, getObject
 

Field Detail

writeBlock

protected final java.lang.Object writeBlock
Define the write block (Object) field.


readBlock

protected final java.lang.Object readBlock
Define the read block (Object) field.


sentMessage

protected MessageService sentMessage
Define the sent message (MessageService) field.

Constructor Detail

ResponseTransport

protected ResponseTransport()
Constructs an ResponseTransport object.

Method Detail

fireMessageReceived

public void fireMessageReceived(java.lang.Object timestamp,
                                MessageService message)
Description copied from class: Transport
Perform the fireMessageReceived action method. java.lang.Object org.eclipse.soda.dk.message.service.MessageService

Overrides:
fireMessageReceived in class Transport
Parameters:
timestamp - The timestamp (Object) parameter.
message - The message (MessageService) parameter.
See Also:
Transport.startupMessageReceived(TransportService,Object,MessageService)

fireMessageReceivedNoResponse

public void fireMessageReceivedNoResponse(java.lang.Object timestamp,
                                          MessageService message)
Parameters:
timestamp - The timestamp (Object) parameter.
message - The message (MessageService) parameter.

getDefaultResponseTimeout

public long getDefaultResponseTimeout()
Gets the long defaultResponseTimeout property value.

Returns:
Results of the get default response timeout (long) value.

getLastWriteBytes

protected byte[] getLastWriteBytes()
Gets the byte[] last bytes written.

Returns:
Results of the get last write bytes (byte[]) value.
See Also:
setLastWriteBytes(byte[])

getResponseMessageCount

public long getResponseMessageCount()
Gets the response message count (long) value.

Returns:
The response message count (long) value.
See Also:
setResponseMessageCount(long), updateResponseMessageCount()

getResponseTimeout

public long getResponseTimeout()
Gets the long responseTimeout property value.

Returns:
Results of the get response timeout (long) value.
See Also:
getDefaultResponseTimeout(), setResponseTimeout(long)

getSentMessage

public MessageService getSentMessage()
Gets the sent message (MessageService) value.

Returns:
The sent message (MessageService) value.
See Also:
setSentMessage(MessageService)

getShutdownTimeout

public long getShutdownTimeout()
Gets the shutdown timeout (long) value.

Overrides:
getShutdownTimeout in class ThreadTransport
Returns:
The shutdown timeout (long) value.

responseReceived

public void responseReceived()
Response received.

See Also:
fireMessageReceived(Object,MessageService)

setLastWriteBytes

protected void setLastWriteBytes(byte[] lastWriteBytes)
Parameters:
lastWriteBytes - The last write bytes (byte[]) parameter.
See Also:
getLastWriteBytes()

setResponseMessageCount

public void setResponseMessageCount(long responseMessageCount)
Parameters:
responseMessageCount - The response message count (long) parameter.
See Also:
getResponseMessageCount(), updateResponseMessageCount()

setResponseTimeout

public void setResponseTimeout(long responseTimeout)
Sets the responseTimeout property. The new property value (long).

Parameters:
responseTimeout - The response timeout (long) parameter.
See Also:
getDefaultResponseTimeout(), getResponseTimeout()

setSentMessage

public void setSentMessage(MessageService sentMessage)
Parameters:
sentMessage - The sent message (MessageService) parameter.
See Also:
getSentMessage()

setup

public void setup()
Description copied from class: Transport
Setup the transport.

Overrides:
setup in class ConnectionTransport
See Also:
Transport.setup()

updateResponseMessageCount

public long updateResponseMessageCount()
Update response message count and return the long result.

Returns:
Results of the update response message count (long) value.
See Also:
getResponseMessageCount(), setResponseMessageCount(long)

write

public void write(byte[] sendBytes)
           throws java.lang.Exception
Description copied from class: ConnectionTransport
Perform the send action method. byte[] href="java.io.IOException.html">IOException Thrown if the IOException exception condition occurs.

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

write

protected void write(MessageService message)
              throws java.lang.Exception
Description copied from class: Transport
Write (send) the specified message after converting the message to the correct set of bytes to be written. This is the method common method to be overridden by subclasses to convert a message to the correct set of bytes to be written. The message to be written (sent).

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

write

protected void write(byte[] bytes,
                     long responseTimeout)
              throws java.lang.Exception
Parameters:
bytes - The bytes (byte[]) parameter.
responseTimeout - The response timeout (long) parameter.
Throws:
java.lang.Exception - Exception.
See Also:
write(byte[]), write(MessageService)

writeRaw

protected void writeRaw(byte[] sendBytes)
                 throws java.lang.Exception
Write raw with the specified send bytes parameter.

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

2008-02-07 1.1.0

Copyright (c) 1999, 2008 IBM and others. See license in Legal section. OSGi Framework Version 3.3.1.R33x_v20070828