| java.lang.Object seda.sandStorm.core.ssTimer
ssTimer | public class ssTimer implements Runnable,ProfilableIF(Code) | | The ssTimer class provides a mechanism for registering
timer events that will go off at some future time. The future time
can be specified in absolute or relative terms. When the timer goes
off, an element is placed on a queue. There is no way to unregister
a timer. Events will be delivered guaranteed, but the time that they
are delivered may slip depending on stuff like how loaded the system
is and all that.
WARNING: you should use cancelEvent to cancel timers that you no longer
need, otherwise you will waste many, many cycles on unneeded timer
firings. This was the bottleneck in vSpace and the DDS before we
fixed it. For example, if you set a timer to go off on a cross-CPU
task to detect failure, then if the task returns successfully, cancel
the timer!
author: Matt Welsh and Steve Gribble |
Inner Class :public static class ssTimerEvent | |
Constructor Summary | |
public | ssTimer() |
cancelAll | public void cancelAll()(Code) | | Cancels all events.
|
cancelEvent | public void cancelEvent(ssTimerEvent evt)(Code) | | Cancels the firing of this timer event.
Parameters: evt - the ssTimer.ssTimerEvent to cancel. This ssTimerEventis returned to you when you call registerEvent |
doneWithTimer | public void doneWithTimer()(Code) | | Kills off this timer object, dropping all pending events on floor.
|
profileSize | public int profileSize()(Code) | | Return the profile size of this timer.
|
registerEvent | public ssTimer.ssTimerEvent registerEvent(long millis, QueueElementIF obj, SinkIF queue)(Code) | | Object obj will be placed on SinkIF queue
no earlier than millis milliseconds from now.
Parameters: millis - the number of milliseconds from now when the event willtake place Parameters: obj - the object that will be placed on the queue Parameters: queue - the queue on which the object will be placed |
registerEvent | public ssTimer.ssTimerEvent registerEvent(java.util.Date the_date, QueueElementIF obj, SinkIF queue)(Code) | | Object obj will be placed on SinkIF queue
no earlier than absolute time the_date .
Parameters: the_date - the date when the event will take place - if this dateis in the past, the event will happen right away Parameters: obj - the object that will be placed on the queue Parameters: queue - the queue on which the object will be placed |
size | public int size()(Code) | | How many events yet to fire?
|
|
|