stella.xml
Class LoopingSequencer.Conditioner

java.lang.Object
  extended by java.lang.Thread
      extended by stella.xml.LoopingSequencer.Conditioner
All Implemented Interfaces:
Runnable, AlarmHandler
Enclosing class:
LoopingSequencer

private class LoopingSequencer.Conditioner
extends Thread
implements AlarmHandler

The helper class that deals with incoming reply messages. First, the sequencer is called to convert the incoming reply to a valid variable name. Then, the conditioner roams through its list of variables and

This method synchronizes on the variable map. It starts itself after construction.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  ReplyEvent reply
          The reply received.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private LoopingSequencer.Conditioner(ReplyEvent rep)
          Constructs and starts a new conditioner processing the argument reply event.
 
Method Summary
 void run()
          The run method of the conditioner.
 void setOff(String varname)
          This method is called if a delayed condition is met.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

reply

private ReplyEvent reply
The reply received.

Constructor Detail

LoopingSequencer.Conditioner

private LoopingSequencer.Conditioner(ReplyEvent rep)
Constructs and starts a new conditioner processing the argument reply event.

Method Detail

setOff

public void setOff(String varname)
This method is called if a delayed condition is met. I.e. booleans like DONE_MOVE+1000 are treated here. Whenever the DONE_MOVE reply is registered in the LoopingSequencer.forward(stella.ReplyEvent) receiving end an Alarm is spawned with the specified delay time (ms). If the alarm ran out the alarm threads name is used to set the matching boolean variable to true.

Specified by:
setOff in interface AlarmHandler
Parameters:
The - name of the alarm thread equal the variable name

run

public void run()
The run method of the conditioner. It synchronizes on the variable map. Entries in this map matching the variable name constructed from the original reply are treated in the following way:

Specified by:
run in interface Runnable
Overrides:
run in class Thread