|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.renesys.raceway.SSF.Entity
|
+--SSF.OS.Timer
Efficient timers for SSF simulations. A timer is an entity that wraps itself in a TimerEvent (inner class), and sends itself to itself on a local channel with the appropriate timeout delay. When the delivery occurs, it checks to see whether it has been cancelled; if not, it executes its own callback method.
For efficiency, all timers for a given entity use the same loopback channel and process; in an entity that uses multiple timers, all but the first are "lightweight" timers that use the initial timer's loopback mechanism.
| Constructor Summary | |
Timer(ProtocolGraph e,
long dt)
Build a timer for the specified Entity with the specified duration. |
|
| Method Summary | |
abstract void |
callback()
Action to be taken upon expiration if the timer has not been cancelled. |
void |
cancel()
Specify that the callback event for this timer should not be executed when it expires. |
boolean |
isCancelled()
Determine whether this timer has been cancelled. |
void |
set()
Set this timer. |
void |
set(long dt)
Set this timer to expire after the given delay. |
| Methods inherited from class com.renesys.raceway.SSF.Entity |
alignment, alignTo, coalignedEntities, inChannels, init, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resetSimulation, resumeAll, startAll, startAll, startClient, startClient, startServer, Vx, Yx |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Timer(ProtocolGraph e,
long dt)
e - Entity on whose behalf this Timer fires.dt - Duration (in logical ticks) before expiration of the timer.| Method Detail |
public boolean isCancelled()
public abstract void callback()
public void set()
public void set(long dt)
public final void cancel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||