eaLib API Docs
Last Modified : January 7 2002

mss.ea.al
Class ThreadSynchronization

java.lang.Object
  |
  +--mss.ea.al.ThreadSynchronization

Deprecated. superceded by new thread communication model

public class ThreadSynchronization
extends java.lang.Object

Provides synchronization between operator and controller threads.

Since:
0.1
Version:
$Revision: 1.6 $ $Date: 2001/11/12 17:22:13 $
Author:
Andreas Rummler

Field Summary
static int CLOSE
          Deprecated. State indicator CLOSE.
static int COMPLETE
          Deprecated. State indicator COMPLETE.
protected  ThreadController controller
          Deprecated. Controller of the running algorithm.
static int HANGUP
          Deprecated. State indicator HANGUP.
protected  java.util.HashSet operatorSet
          Deprecated. Hash set containing all normal operators.
static int REQUEST_HANGUP
          Deprecated. State indicator REQUEST_HANGUP.
static int REQUEST_RUN
          Deprecated. State indicator REQUEST_RUN.
static int REQUEST_STANDBY
          Deprecated. State indicator REQUEST_STANDBY.
static int RUN
          Deprecated. State indicator RUN.
static int SETUP
          Deprecated. State indicator SETUP.
protected  java.util.HashSet sinkSet
          Deprecated. Hash set containing all sinks.
protected  java.util.HashSet sourceSet
          Deprecated. Hash set containing all sources.
static int STANDBY
          Deprecated. State indicator STANDBY.
protected  java.util.HashMap stateMap
          Deprecated. Hash map with mappings from operators to their current states.
protected  java.lang.ThreadGroup threadGroup
          Deprecated. Threadgroup containing all threads that are created during the algorithm.
static int WAIT
          Deprecated. State indicator WAIT.
 
Constructor Summary
ThreadSynchronization(ThreadController tc)
          Deprecated. Constructor.
 
Method Summary
protected  boolean checkHangup()
          Deprecated. Checks if operators have reached the HANGUP state.
protected  boolean checkPredecessorComplete(ThreadOperator operator)
          Deprecated. Checks if all predecessors have reached the COMPLETE state.
protected  boolean checkSinkCompletion()
          Deprecated. Checks, if sinks have reached the CLOSE state.
protected  boolean checkStandby()
          Deprecated. Checks, if all operators have reached the STANDBY state.
protected  boolean checkState(ThreadOperator operator, int state)
          Deprecated. Checks the state of an operator.
 void dumpState()
          Deprecated. Dumps the states of all operators to System.out (ONLY FOR DEBUGGING).
 java.util.HashSet getOperators()
          Deprecated. Gets the registered operators.
 java.util.HashSet getSinks()
          Deprecated. Gets the registered sinks.
 java.util.HashSet getSources()
          Deprecated. Gets the registered sources.
protected  int getState(ThreadOperator operator)
          Deprecated. Gets the current state of an operator.
 void register(ThreadOperator operator)
          Deprecated. Registers a new operator.
protected  void setState(ThreadOperator operator, int state)
          Deprecated. Sets the state of an operator.
 void signalizeHangup()
          Deprecated. Signal REQUEST_HANGUP to all operators.
 void signalizeHangup(ThreadOperator operator)
          Deprecated. Signal that the HANGUP state has been reached.
 void signalizeOperation(ThreadOperator operator)
          Deprecated. Signal RUN.
 void signalizeOperationRequest(ThreadOperator operator)
          Deprecated. Sets the REQUEST_RUN signal to an operator.
 void signalizeSinkClose(SinkThread sink)
          Deprecated. Signal CLOSE from a sink.
 void signalizeSourceRunning()
          Deprecated. Signal REQUEST_RUN to all sources.
 void signalizeStandby()
          Deprecated. Signalizes all operator to go to STANDBY state.
 void signalizeStandby(ThreadOperator operator)
          Deprecated. Signal that the STANDBY state has been reached.
 void waitForever()
          Deprecated. Caller will wait forever (ONLY FOR DEBUGGING).
 void waitForever(ThreadOperator operator)
          Deprecated. Target will wait forever (ONLY FOR DEBUGGING).
 void waitForHangup()
          Deprecated. Wait for HANGUP signal from all operators.
 void waitForOperation(ThreadOperator operator)
          Deprecated. Wait for further requests.
 void waitForOperationOrHangup(ThreadOperator operator)
          Deprecated. Wait for REQUEST_RUN of HANGUP signal.
 void waitForSinkCompletion()
          Deprecated. Wait for COMPLETE signal from all sinks.
 void waitForStandbyCompletion()
          Deprecated. Wait for all operators to reach STANDBY state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SETUP

public static final int SETUP
Deprecated. 
State indicator SETUP.

REQUEST_STANDBY

public static final int REQUEST_STANDBY
Deprecated. 
State indicator REQUEST_STANDBY.

REQUEST_RUN

public static final int REQUEST_RUN
Deprecated. 
State indicator REQUEST_RUN.

REQUEST_HANGUP

public static final int REQUEST_HANGUP
Deprecated. 
State indicator REQUEST_HANGUP.

STANDBY

public static final int STANDBY
Deprecated. 
State indicator STANDBY.

RUN

public static final int RUN
Deprecated. 
State indicator RUN.

WAIT

public static final int WAIT
Deprecated. 
State indicator WAIT.

COMPLETE

public static final int COMPLETE
Deprecated. 
State indicator COMPLETE.

HANGUP

public static final int HANGUP
Deprecated. 
State indicator HANGUP.

CLOSE

public static final int CLOSE
Deprecated. 
State indicator CLOSE.

controller

protected ThreadController controller
Deprecated. 
Controller of the running algorithm.

stateMap

protected java.util.HashMap stateMap
Deprecated. 
Hash map with mappings from operators to their current states.

sourceSet

protected java.util.HashSet sourceSet
Deprecated. 
Hash set containing all sources.

operatorSet

protected java.util.HashSet operatorSet
Deprecated. 
Hash set containing all normal operators.

sinkSet

protected java.util.HashSet sinkSet
Deprecated. 
Hash set containing all sinks.

threadGroup

protected java.lang.ThreadGroup threadGroup
Deprecated. 
Threadgroup containing all threads that are created during the algorithm.
Constructor Detail

ThreadSynchronization

public ThreadSynchronization(ThreadController tc)
Deprecated. 
Constructor.
Parameters:
tc - controller of the algorithm
Method Detail

signalizeStandby

public void signalizeStandby()
Deprecated. 
Signalizes all operator to go to STANDBY state. All operators are started and are waiting for further requests.

signalizeStandby

public void signalizeStandby(ThreadOperator operator)
Deprecated. 
Signal that the STANDBY state has been reached.
Parameters:
operator - producer of the signal

waitForStandbyCompletion

public void waitForStandbyCompletion()
Deprecated. 
Wait for all operators to reach STANDBY state.

checkStandby

protected boolean checkStandby()
Deprecated. 
Checks, if all operators have reached the STANDBY state.
Returns:
result of the check

signalizeSourceRunning

public void signalizeSourceRunning()
Deprecated. 
Signal REQUEST_RUN to all sources.

waitForSinkCompletion

public void waitForSinkCompletion()
Deprecated. 
Wait for COMPLETE signal from all sinks.

checkSinkCompletion

protected boolean checkSinkCompletion()
Deprecated. 
Checks, if sinks have reached the CLOSE state.
Returns:
result of the check

signalizeHangup

public void signalizeHangup()
Deprecated. 
Signal REQUEST_HANGUP to all operators.

signalizeHangup

public void signalizeHangup(ThreadOperator operator)
Deprecated. 
Signal that the HANGUP state has been reached.
Parameters:
operator - producer of the signal

waitForHangup

public void waitForHangup()
Deprecated. 
Wait for HANGUP signal from all operators.

checkHangup

protected boolean checkHangup()
Deprecated. 
Checks if operators have reached the HANGUP state.
Returns:
result of the check

waitForOperation

public void waitForOperation(ThreadOperator operator)
Deprecated. 
Wait for further requests.
Parameters:
operator - producer of the wait signal

checkPredecessorComplete

protected boolean checkPredecessorComplete(ThreadOperator operator)
Deprecated. 
Checks if all predecessors have reached the COMPLETE state.
Parameters:
operator -  
Returns:
result of the check

signalizeOperationRequest

public void signalizeOperationRequest(ThreadOperator operator)
Deprecated. 
Sets the REQUEST_RUN signal to an operator.
Parameters:
operator - target of the signal

signalizeOperation

public void signalizeOperation(ThreadOperator operator)
Deprecated. 
Signal RUN.
Parameters:
operator - producer of the signal

signalizeSinkClose

public void signalizeSinkClose(SinkThread sink)
Deprecated. 
Signal CLOSE from a sink.
Parameters:
sink - producer of the signal

waitForOperationOrHangup

public void waitForOperationOrHangup(ThreadOperator operator)
Deprecated. 
Wait for REQUEST_RUN of HANGUP signal.
Parameters:
operator - producer of the wait signal.

register

public void register(ThreadOperator operator)
Deprecated. 
Registers a new operator.
Parameters:
operator - operator to register

getState

protected int getState(ThreadOperator operator)
Deprecated. 
Gets the current state of an operator.
Parameters:
operator -  
Returns:
current state

setState

protected void setState(ThreadOperator operator,
                        int state)
Deprecated. 
Sets the state of an operator.
Parameters:
operator - operator which state should be set
state - new state of the operator

checkState

protected boolean checkState(ThreadOperator operator,
                             int state)
Deprecated. 
Checks the state of an operator.
Parameters:
operator - operator to check
state - state to check for
Returns:
true if the operator is in the given state

getSources

public java.util.HashSet getSources()
Deprecated. 
Gets the registered sources.
Returns:
hashset with sources

getOperators

public java.util.HashSet getOperators()
Deprecated. 
Gets the registered operators.
Returns:
hashset with normal operators

getSinks

public java.util.HashSet getSinks()
Deprecated. 
Gets the registered sinks.
Returns:
hashset with sinks

dumpState

public void dumpState()
Deprecated. 
Dumps the states of all operators to System.out (ONLY FOR DEBUGGING).

waitForever

public void waitForever()
Deprecated. 
Caller will wait forever (ONLY FOR DEBUGGING).

waitForever

public void waitForever(ThreadOperator operator)
Deprecated. 
Target will wait forever (ONLY FOR DEBUGGING).
Parameters:
operator - target of the call

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS