javax.realtime
Class OneShotTimer

java.lang.Object
  |
  +--javax.realtime.AsyncEvent
        |
        +--javax.realtime.Timer
              |
              +--javax.realtime.OneShotTimer

public class OneShotTimer
extends Timer

A timed AsyncEvent that is driven by a clock. It will fire off once, when the clock time reaches the timeout time. If the clock time has already passed the timeout time, it will fire immediately.


Fields inherited from class javax.realtime.Timer
clock, isEnabled, started, time, timerThread, waitLock
 
Constructor Summary
OneShotTimer(HighResolutionTime time, AsyncEventHandler handler)
          Create an instance of AsyncEvent that will excute its fire method at the expiration of the given time.
OneShotTimer(HighResolutionTime start, Clock clock, AsyncEventHandler handler)
          Create an instance of AsyncEvent, based on the given clock, that will excute its fire method at the expiration of the given time.
 
Method Summary
protected  void Init()
          Called from super class start method
 
Methods inherited from class javax.realtime.Timer
createReleaseParameters, destroy, disable, enable, getClock, getFireTime, reschedule, start
 
Methods inherited from class javax.realtime.AsyncEvent
addHandler, bindTo, fire, handledBy, removeHandler, setHandler, unbindTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneShotTimer

public OneShotTimer(HighResolutionTime time,
                    AsyncEventHandler handler)
Create an instance of AsyncEvent that will excute its fire method at the expiration of the given time.
Parameters:
time - - After timeout time units from 'now' fire will be excuted
handler - - The AsyncEventHandler that will be scheduled when fire is excuted

OneShotTimer

public OneShotTimer(HighResolutionTime start,
                    Clock clock,
                    AsyncEventHandler handler)
Create an instance of AsyncEvent, based on the given clock, that will excute its fire method at the expiration of the given time.
Parameters:
start - start time for timer
clock - The timer will increment based on this clock
handler - The AsyncEventHandler that will be scheduled when fire is excuted
Method Detail

Init

protected void Init()
Called from super class start method
Overrides:
Init in class Timer