org.eclipse.soda.dk.transport
Class ThreadTransport
java.lang.Object
org.eclipse.soda.dk.core.EscObject
org.eclipse.soda.dk.transport.Transport
org.eclipse.soda.dk.transport.ThreadTransport
- All Implemented Interfaces:
- java.lang.Runnable, ConfigurationService, TransportService
- Direct Known Subclasses:
- ConnectionTransport, UdpTransport
public class ThreadTransport
- extends Transport
- implements java.lang.Runnable
The ThreadTransport class is an implementation of the TransportService interface that handles process input on another thread.
- Version:
- 1.1.0
- See Also:
Message,
EscObject,
Transport,
MessageService,
Runnable,
Thread,
TransportService
| 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, logLevel, MESSAGE_FILTERED_RESOURCE, MESSAGE_RECEIVED_EXCEPTION_RESOURCE, MESSAGE_RECEIVED_RESOURCE, MESSAGE_SENT_RESOURCE, NACK_RECEIVED_RESOURCE, NO_ACTIVITY_RESOURCE, NO_ACTIVITY_STATUS_ERROR, NO_ACTIVITY_STATUS_MESSAGE_SENT, NO_ACTIVITY_STATUS_UNKNOWN, NO_ACTIVITY_TIMEOUT_DEFAULT, noActivityTimeout, notificationService, prefixMetrics, prefixStatus, PROCESS_INPUT_EXCEPTION_RESOURCE, QUEUE_TOO_BIG_RESOURCE, RECONNECT_RESOURCE, RETRY_TIME_DEFAULT, 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, TRANSMIT_RETRIES_DEFAULT, 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, ID_NAME_KEY, INTEGER_TABLE, INTEGER_TABLE_SIZE, KEY_KEY, LOG_DEBUG, LOG_DEFAULT, LOG_ERROR, LOG_INFO, LOG_LEVEL_KEY, LOG_TRACE, LOG_WARNING, LONG_TABLE, LONG_TABLE_SIZE, PREFIX_KEY, READONLY_EMPTY_COLLECTION, READONLY_EMPTY_LIST, READONLY_EMPTY_MAP, 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, Unmodifiable |
| Fields inherited from interface org.eclipse.soda.dk.transport.service.TransportService |
ACTIVE, ALIVE, CONFIGURATION_DATA_KEY, CONNECTED, CONNECTION_DEFAULT, 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 |
ThreadTransport()
Constructs a standard ThreadTransport object. |
|
Method Summary |
int |
getBufferSize()
Gets the int bufferSize property value. |
long |
getShutdownTimeout()
Gets the shutdown timeout (long) value. |
java.lang.Thread |
getThread()
Gets the Thread thread property value. |
void |
handleNoData()
Perform the handleNoData action method. |
void |
handleNoInput()
Perform the handleNoInput action method. |
boolean |
isRunning()
Gets the boolean running property value. |
protected void |
processInput()
Perform the processInput action method. |
protected int |
processInput(byte[] bytes,
int length)
Process input bytes looking for input message(s). |
protected void |
processInput(int value)
Perform the processInput action method. |
void |
run()
Perform the run action method. |
void |
setRunning(boolean running)
Sets the running property. |
void |
setThread(java.lang.Thread thread)
Sets the thread property. |
void |
shutdown(boolean output)
|
void |
start()
Perform the startup action method. |
void |
stop()
Stop. |
| Methods inherited from class org.eclipse.soda.dk.transport.Transport |
addHistory, addInterest, addTransportListener, attemptRecoveryFromError, broadcastMetrics, broadcastStatus, close, configure, connect, createController, exit, finalize, fireErrorOccurred, fireMessageReceived, fireTransportChanged, getConfigurationInformation, getConfigurationInformation, getConfigurationService, getConnection, getController, getErrorCount, getErrorSeverity, getHistory, getInformation, getInputMessageCount, getInterestMask, getKey, getLogDetails4, getLogDetails5, getLogLevel, getNoActivityTimeout, getNotificationPriority, getNotificationService, getPrefix, getPriority, getProperties, getQualifiedKey, getResource, getRetryTime, getSentMessageCount, getState, getStateChangeCount, getString, getStyle, getTransmitRetries, getTransportListener, handleError, hasListeners, isActive, isEcho, isReceivingData, isReceivingGoodData, isReceivingInput, isStarted, log, noActivityProcessing, noActivityProcessingMessage, prependPrefix, prependPrefix, putConfigurationInformation, read, removeInterest, removeTransportListener, restart, restartProcessing, send, send, setActive, setConfigurationInformation, setController, setEcho, setErrorCount, setHistory, setInformation, setInputMessageCount, setInterestMask, setLogLevel, setNoActivityTimeout, setNotificationService, setReceivingData, setReceivingData, setReceivingGoodData, setReceivingGoodData, setReceivingInput, setReceivingInput, setRetryTime, setSentMessageCount, setState, setStateChangeCount, setStyle, setTransmitRetries, setTransportListener, setup, setupCustom, start, startup, startupMessageReceived, toString, updateErrorCount, updateInputMessageCount, updateSentMessageCount, waitStateChange, waitStateChange, write, write, writeAndReport, writeAndReport |
| Methods inherited from class org.eclipse.soda.dk.core.EscObject |
createDefaultLogService, createException, createException, createInteger, createIntegerTable, createLong, createLongTable, createNumber, format, getBoolean, getCurrentTimestamp, getDefaultLogService, getDefaultResource, getFloat, getId, getIdName, getInt, getLoadLibraryName, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails6, getLogDetails7, getLogService, getLong, getObject, getOutputName, getReadOnlyEmptyCollection, getReadOnlyEmptyList, getReadOnlyEmptyMap, getSimpleClassName, getStaticBoolean, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleError, handleErrorInternal, handleStaticError, handleStaticException, isBackward, isDebug, isLogging, isTrace, isUnmodifiable, loadService, log, log, report, report, report, report, report, report, reportError, reportSystemInfo, setBackward, setDebug, setDefaultLogService, setLogService, setTraceLevel, setUnmodifiable, shouldLog, sleep, startupEscStatic, toStringConfigurationKeys, toStringInfo |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ThreadTransport
public ThreadTransport()
- Constructs a standard
ThreadTransport object.
getBufferSize
public int getBufferSize()
- Gets the
int bufferSize property value. The buffer size is used as the buffer size in the processing input. The buffer size should be larger than the biggest message that can be received.
- Returns:
- Results of the get buffer size (
int) value.
getShutdownTimeout
public long getShutdownTimeout()
- Gets the shutdown timeout (long) value.
- Returns:
- The shutdown timeout (
long) value.
getThread
public java.lang.Thread getThread()
- Gets the
Thread thread property value.
- Returns:
- Results of the get thread (
Thread) value. - See Also:
setThread(Thread)
handleNoData
public void handleNoData()
- Perform the handleNoData action method.
handleNoInput
public void handleNoInput()
- Perform the handleNoInput action method.
isRunning
public boolean isRunning()
- Gets the
boolean running property value.
- Returns:
- Results of the is running (
boolean) value. - See Also:
setRunning(boolean)
processInput
protected void processInput()
throws java.lang.Exception
- Perform the processInput action method.
- Throws:
java.lang.Exception - Exception.- See Also:
handleNoInput(),
processInput(byte[],int),
processInput(int)
processInput
protected int processInput(byte[] bytes,
int length)
throws java.lang.Exception
- Process input bytes looking for input message(s). All complete messages should be processed and the number of bytes processed should be returned. The default implementation of this to call processInput of each byte and return the specified length.
byte[]
int
- Parameters:
bytes - The bytes (byte[]) parameter.length - The length (int) parameter.
- Returns:
- int Return the number of bytes processed
- Throws:
java.lang.Exception - Exception.- See Also:
handleNoInput(),
processInput(),
processInput(int)
processInput
protected void processInput(int value)
throws java.lang.Exception
- Perform the processInput action method.
int
- Parameters:
value - The value (int) parameter.
- Throws:
java.lang.Exception - Exception.- See Also:
handleNoInput(),
processInput(),
processInput(byte[],int)
run
public void run()
- Perform the run action method.
- Specified by:
run in interface java.lang.Runnable
- See Also:
Runnable.run()
setRunning
public void setRunning(boolean running)
- Sets the running property. The new property value (
boolean).
- Parameters:
running - The running (boolean) parameter.- See Also:
isRunning()
setThread
public void setThread(java.lang.Thread thread)
- Sets the thread property. The new property value (
java.lang.Thread).
- Parameters:
thread - The thread (Thread) parameter.- See Also:
getThread()
shutdown
public void shutdown(boolean output)
- Overrides:
shutdown in class Transport
- Parameters:
output - The output (boolean) parameter.
start
public void start()
- Perform the startup action method. This method is called to startup the transport. If you override this method, you should call you superclass before your startup logic. param boolean output If true, then output an errors.
- Specified by:
start in interface TransportService- Overrides:
start in class Transport
- See Also:
TransportService.start(),
Transport.start(boolean)
stop
public void stop()
- Stop.
- Specified by:
stop in interface TransportService- Overrides:
stop in class Transport
- See Also:
TransportService.stop()
Copyright (c) 1999, 2008 IBM and others. See license in Legal section. OSGi Framework Version 3.4.0.v20080605-1900