2008-07-29 1.1.0

org.eclipse.soda.dk.transport
Class Controller

java.lang.Object
  extended by org.eclipse.soda.dk.core.EscObject
      extended by org.eclipse.soda.dk.transport.ControllerQueue
          extended by org.eclipse.soda.dk.transport.Controller
All Implemented Interfaces:
java.lang.Runnable, ControllerService, ErrorListener, MessageListener, TransportListener

public class Controller
extends org.eclipse.soda.dk.transport.ControllerQueue
implements ControllerService, java.lang.Runnable

The Controller class implements the ControllerService interface.

Version:
1.1.0

Field Summary
static int MESSAGE_STATUS_ERROR
          Define the message status error (int) constant.
static int MESSAGE_STATUS_OK
          Define the message status OK (int) constant.
static int MESSAGE_STATUS_UNKNOWN
          Define the message status unknown (int) constant.
static java.lang.Integer TRANSPORT_STARTED_NO_OUTPUT
          Define the transport started value no output (Integer) constant.
static java.lang.Integer TRANSPORT_STARTED_VALUE
          Define the transport started value (Integer) constant.
 
Fields inherited from class org.eclipse.soda.dk.transport.ControllerQueue
elementsData, elementsTimestamp, maxQueueSize
 
Fields inherited from class org.eclipse.soda.dk.core.EscObject
CLONE_EXCEPTION_RESOURCE, EMPTY_BYTES, EMPTY_STRING, ERROR_OCCURRED_EXCEPTION_RESOURCE, 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
 
Constructor Summary
Controller(Transport transport, int priority)
           
 
Method Summary
protected  void enqueueRestartTransport()
          Enqueue restart transport.
protected  void enqueueRestartTransportNoOutput()
          Enqueue restart transport no output.
 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 errorOccurredSend(java.lang.Object source, java.lang.Object timestamp, java.lang.Object data)
           
 int getQueueSizeProblem()
          Gets the queue size problem (int) value.
 void messageReceived(TransportService transportService, java.lang.Object timestamp, MessageService message)
          This API will be called each time the TransportService receives a valid message.
 void restartTransport()
          Restart transport.
 void run()
          Perform the run action method.
 void setQueueSizeProblem(int queueSizeProblem)
           
 void start()
          Start.
 void start(boolean output)
          Start the transport.
 void startProcessing(boolean output)
           
 void stop()
          Stop.
 void stop(boolean output)
          Stop the transport.
 void trace(java.lang.String debugMessage)
           
 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 transportChangedSend(TransportService source, java.lang.Object timestamp, int newState, int oldState)
           
 
Methods inherited from class org.eclipse.soda.dk.transport.ControllerQueue
dequeue, dequeueFirst, enqueue, getFirst, getMaxQueueSize, getMaxSize, handleFull, setMaxQueueSize, size, toString
 
Methods inherited from class org.eclipse.soda.dk.core.EscObject
attemptRecoveryFromError, createDefaultLogService, createException, createException, createInteger, createIntegerTable, createLong, createLongTable, createNumber, format, getBoolean, getConfigurationService, getCurrentTimestamp, getDefaultLogService, getDefaultResource, getErrorSeverity, getFloat, getId, getIdName, getInt, getLoadLibraryName, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails4, getLogDetails5, getLogDetails6, getLogDetails7, getLogLevel, getLogService, getLong, getObject, getOutputName, getReadOnlyEmptyCollection, getReadOnlyEmptyList, getReadOnlyEmptyMap, getResource, getSimpleClassName, getStaticBoolean, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticString, getString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleError, handleError, handleErrorInternal, handleStaticError, handleStaticException, isDebug, isLogging, isTrace, loadService, log, log, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MESSAGE_STATUS_UNKNOWN

public static final int MESSAGE_STATUS_UNKNOWN
Define the message status unknown (int) constant.

See Also:
Constant Field Values

MESSAGE_STATUS_OK

public static final int MESSAGE_STATUS_OK
Define the message status OK (int) constant.

See Also:
Constant Field Values

MESSAGE_STATUS_ERROR

public static final int MESSAGE_STATUS_ERROR
Define the message status error (int) constant.

See Also:
Constant Field Values

TRANSPORT_STARTED_NO_OUTPUT

public static final java.lang.Integer TRANSPORT_STARTED_NO_OUTPUT
Define the transport started value no output (Integer) constant.


TRANSPORT_STARTED_VALUE

public static final java.lang.Integer TRANSPORT_STARTED_VALUE
Define the transport started value (Integer) constant.

Constructor Detail

Controller

public Controller(Transport transport,
                  int priority)
Parameters:
transport - The transport (Transport) parameter.
priority - The priority (int) parameter.
Method Detail

enqueueRestartTransport

protected void enqueueRestartTransport()
Enqueue restart transport.


enqueueRestartTransportNoOutput

protected void enqueueRestartTransportNoOutput()
Enqueue restart transport no output.


errorOccurred

public void errorOccurred(java.lang.Object source,
                          java.lang.Object timestamp,
                          java.lang.Object data)
Description copied from interface: ErrorListener
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.

errorOccurredSend

public void errorOccurredSend(java.lang.Object source,
                              java.lang.Object timestamp,
                              java.lang.Object data)
Parameters:
source - The source (Object) parameter.
timestamp - The timestamp (Object) parameter.
data - The data (Object) parameter.

getQueueSizeProblem

public int getQueueSizeProblem()
Gets the queue size problem (int) value.

Returns:
The queue size problem (int) value.
See Also:
setQueueSizeProblem(int)

messageReceived

public void messageReceived(TransportService transportService,
                            java.lang.Object timestamp,
                            MessageService message)
Description copied from interface: MessageListener
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.

restartTransport

public void restartTransport()
Restart transport.

Specified by:
restartTransport in interface ControllerService
See Also:
enqueueRestartTransport()

run

public void run()
Perform the run action method.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

setQueueSizeProblem

public void setQueueSizeProblem(int queueSizeProblem)
Parameters:
queueSizeProblem - The queue size problem (int) parameter.
See Also:
getQueueSizeProblem()

start

public void start()
Start.

Specified by:
start in interface ControllerService
See Also:
start(boolean)

start

public void start(boolean output)
Description copied from interface: ControllerService
Start the transport. if true output any errors else do not output errors.

Specified by:
start in interface ControllerService
Parameters:
output - The output (boolean) parameter.
See Also:
start()

startProcessing

public void startProcessing(boolean output)
Parameters:
output - The output (boolean) parameter.

stop

public void stop()
Stop.

Specified by:
stop in interface ControllerService
See Also:
stop(boolean)

stop

public void stop(boolean output)
Description copied from interface: ControllerService
Stop the transport. if true output any errors else do not output errors.

Specified by:
stop in interface ControllerService
Parameters:
output - The output (boolean) parameter.
See Also:
stop()

trace

public void trace(java.lang.String debugMessage)
Specified by:
trace in interface ControllerService
Parameters:
debugMessage - The debug message (String) parameter.

transportChanged

public void transportChanged(TransportService transportService,
                             java.lang.Object timestamp,
                             int newState,
                             int oldState)
Description copied from interface: TransportListener
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.

transportChangedSend

public void transportChangedSend(TransportService source,
                                 java.lang.Object timestamp,
                                 int newState,
                                 int oldState)
Parameters:
source - The source (TransportService) parameter.
timestamp - The timestamp (Object) parameter.
newState - The new state (int) parameter.
oldState - The old state (int) parameter.

2008-07-29 1.1.0

Copyright (c) 1999, 2008 IBM and others. See license in Legal section. OSGi Framework Version 3.4.0.v20080605-1900