org.objectweb.jonas_timer.TimerManager Class Reference

Collaboration diagram for org.objectweb.jonas_timer.TimerManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void clock ()
void batch ()
TimerEvent addTimer (TimerEventListener tel, long timeout, Object arg, boolean permanent)
TimerEvent addTimerMs (TimerEventListener tel, long timeout, Object arg, boolean permanent)
void removeTimer (TimerEvent te)

Static Public Member Functions

TimerManager getInstance ()
void stop (boolean force)

Detailed Description

A timer manager manages 2 lists of timers with 2 threads One thread is a clock which decrements timers every second and passes them when expired in a list of expired timers. The other thread looks in the list of expired timers to process them.

Definition at line 83 of file TimerManager.java.


Member Function Documentation

TimerEvent org.objectweb.jonas_timer.TimerManager.addTimer TimerEventListener  tel,
long  timeout,
Object  arg,
boolean  permanent
 

add a new timer in the list

Parameters:
tel Object that will be notified when the timer expire.
timeout nb of seconds before the timer expires.
arg info passed with the timer
permanent true if the timer is permanent.
Deprecated:
use addTimerMs instead.

Definition at line 254 of file TimerManager.java.

TimerEvent org.objectweb.jonas_timer.TimerManager.addTimerMs TimerEventListener  tel,
long  timeout,
Object  arg,
boolean  permanent
 

add a new timer in the list

Parameters:
tel Object that will be notified when the timer expire.
timeout nb of milliseconds before the timer expires.
arg info passed with the timer
permanent true if the timer is permanent.

Definition at line 265 of file TimerManager.java.

Referenced by org.objectweb.jonas_ejb.container.JTimer.startTimer(), and org.objectweb.jonas_ejb.container.JTimer.timeoutExpired().

void org.objectweb.jonas_timer.TimerManager.batch  ) 
 

process all expired timers

Definition at line 216 of file TimerManager.java.

void org.objectweb.jonas_timer.TimerManager.clock  ) 
 

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.

Definition at line 149 of file TimerManager.java.

TimerManager org.objectweb.jonas_timer.TimerManager.getInstance  )  [static]
 

Get an instance of the TimerManager

Definition at line 115 of file TimerManager.java.

void org.objectweb.jonas_timer.TimerManager.removeTimer TimerEvent  te  ) 
 

remove a timer from the list. this is not very efficient. A better way to do this is TimerEvent.unset()

Deprecated:

Definition at line 282 of file TimerManager.java.

void org.objectweb.jonas_timer.TimerManager.stop boolean  force  )  [static]
 

stop the service

Parameters:
force tell the manager NOT to wait for the timers to be completed

Definition at line 125 of file TimerManager.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:13:24 2005 for JOnAS by  doxygen 1.3.9.1