Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class fi.hut.tcm.jacob.conduits.TimerThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--fi.hut.tcm.jacob.conduits.TimerThread

public final class TimerThread
extends java.lang.Thread
TimerThread TimerThread wakes up at appropriate times to check if there are anybody to wake up. When TimerThread is created it creates queue for timeouts.


Field Summary
static TimerThread instance
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
void cancel(Timeout timeout)
          Cancels a timeout by removing it from the appropriate queue.
void run()
          Runs in a loop, checking for expired timeouts.
void schedule(Timeout timeout)
          Schedules a timeout by placing it in the appropriate queue.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupted, interrupt, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

instance

public static TimerThread instance
Method Detail

run

public void run()
Runs in a loop, checking for expired timeouts. All expired timeouts are moved to RunQueue. If there are any Timeouts left, calculates the next wakeup time and enters wait.
Overrides:
run in class java.lang.Thread

schedule

public void schedule(Timeout timeout)
Schedules a timeout by placing it in the appropriate queue. Wakes up the timerThread so that it can calculate the new wakeup time.

cancel

public void cancel(Timeout timeout)
Cancels a timeout by removing it from the appropriate queue. Doesn't need to wake up the timerThread, that would just be some extra work.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD