sofya.ed.structural
Class ControlData

java.lang.Object
  extended by sofya.ed.structural.ControlData

public final class ControlData
extends java.lang.Object

This class provides thread identity and synchronization variables that are used by a ProgramEventDispatcher when it is executed with another ProgramEventDispatcher as its subject. In such cases, the invoking ProgramEventDispatcher must create two processing threads, one to receive information from the subject event dispatcher, and another to receive information from the subject SocketProbe, which is running in the subject of the subject event dispatcher.

Much of the data in this class is static and thus is shared between all instances. Separate instances are allocated only to assign independent thread identifiers to each processing thread. This class cannot be used to synchronize more than two threads, as there should be no need for that capability.

Version:
03/13/2006
Author:
Alex Kinneer

Field Summary
static java.lang.Object stateLock
          Lock object used to synchronize access to the connection flags.
 
Method Summary
 boolean[] getConnectionFlags()
          Gets the thread connection state flags for the threads coordinated by this control object.
 java.lang.Throwable[] getExceptionStorage()
          Gets the exceptions caught by the processing threads during probe processing.
 boolean[] getStopFlags()
          Gets the thread stop flags for the threads coordinated by this control object.
 int getThreadID()
          Gets the ID associated with the processing thread that owns this control object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stateLock

public static final java.lang.Object stateLock
Lock object used to synchronize access to the connection flags.

Method Detail

getThreadID

public int getThreadID()
Gets the ID associated with the processing thread that owns this control object.

Returns:
The numeric identifier to be used by the thread using this control object.

getConnectionFlags

public boolean[] getConnectionFlags()
Gets the thread connection state flags for the threads coordinated by this control object.

Returns:
The shared thread connection state flags used by the processing threads to indicated whether they are (still) connected and processing probes.

getStopFlags

public boolean[] getStopFlags()
Gets the thread stop flags for the threads coordinated by this control object.

Returns:
The shared thread stop flags used to signal the processing threads to halt processing.

getExceptionStorage

public java.lang.Throwable[] getExceptionStorage()
Gets the exceptions caught by the processing threads during probe processing.

Returns:
The last exception caught by each processing thread during probe processing, if any. This method is guaranteed to return an array of throwables, but the contents of any element may be null, in which case processing completed normally.