javax.realtime
Class OneShotTimer

java.lang.Object
  extended byjavax.realtime.AsyncEvent
      extended byjavax.realtime.Timer
          extended byjavax.realtime.OneShotTimer

public class OneShotTimer
extends Timer

A timed AsynchEvent 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.


Field Summary
protected  OneShotTimerThread oneShotTimerThread
          This OneShotTimer's OneShotTimerThread
 
Fields inherited from class javax.realtime.Timer
clock, time
 
Fields inherited from class javax.realtime.AsyncEvent
handlers
 
Constructor Summary
OneShotTimer(HighResolutionTime time, AsyncEventHandler handler)
          Create an instance of AsynchEvent that will execute its fire method at the expiration of the given time.
OneShotTimer(HighResolutionTime fireTime, Clock clock, AsyncEventHandler handler)
          Create an instance of AsynchEvent that will execute its fire method at the expiration of the given time.
 
Method Summary
 void cancel(OneShotTimerThread thread)
          Cancel this OneShotTimer
 void reschedule(HighResolutionTime fireTime)
          Change the scheduled time for this event.
 
Methods inherited from class javax.realtime.Timer
createReleaseParameters, destroy, disable, enable, getClock, getFireTime, isRunning, start, stop
 
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
 

Field Detail

oneShotTimerThread

protected OneShotTimerThread oneShotTimerThread
This OneShotTimer's OneShotTimerThread

Constructor Detail

OneShotTimer

public OneShotTimer(HighResolutionTime fireTime,
                    Clock clock,
                    AsyncEventHandler handler)
Create an instance of AsynchEvent that will execute its fire method at the expiration of the given time.

Parameters:
fireTime - start time for the timer
clock - the timer will increment based on this clock
handler - the AsynchEventHandler that will be scheduled when fire is executed.

OneShotTimer

public OneShotTimer(HighResolutionTime time,
                    AsyncEventHandler handler)
Create an instance of AsynchEvent that will execute its fire method at the expiration of the given time.

Parameters:
time - after timeout time units from now fire will be executed.
handler - the AsynchEventHandler that will be scheduled when fire is executed.
Method Detail

reschedule

public void reschedule(HighResolutionTime fireTime)
Description copied from class: Timer
Change the scheduled time for this event. Can take either absolute or relative times.

Not currently implemented

Overrides:
reschedule in class Timer
Parameters:
fireTime - The time to reschedule for this event firing; if time is null, the previous fire time is still the time at which this will fire.

cancel

public void cancel(OneShotTimerThread thread)
Cancel this OneShotTimer

Parameters:
thread -