public class TimerManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
TimerEvent |
addTimer(TimerEventListener tel,
long timeout,
java.lang.Object arg,
boolean permanent)
add a new timer in the list
|
void |
batch()
process all expired timers
|
void |
clock()
cney speed up the clock x1000 when shutting down
update all timers in the list
each timer expired is put in a special list of expired timers
they will be processed then by the Batch Thread.
|
static TimerManager |
getInstance()
Get an instance of the TimerManager
|
void |
removeTimer(TimerEvent te)
Deprecated.
|
static void |
stop() |
static void |
stop(boolean force)
stop the service
|
public static TimerManager getInstance()
public static void stop(boolean force)
force
- tell the manager NOT to wait for the timers to be completedpublic static void stop()
public void clock()
public void batch()
public TimerEvent addTimer(TimerEventListener tel, long timeout, java.lang.Object arg, boolean permanent)
tel
- Object that will be notified when the timer expire.timeout
- nb of seconds before the timer expires.arg
- info passed with the timerpermanent
- true if the timer is permanent.public void removeTimer(TimerEvent te)