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 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.

Author:
Angelo Corsaro

Field Summary
 
Fields inherited from class javax.realtime.Timer
clock, isEnabled, isRunning
 
Fields inherited from class javax.realtime.AsyncEvent
handlerList, listIterator, releaseParams
 
Constructor Summary
OneShotTimer(AbsoluteTime time, AsyncEventHandler handler)
          Create an instance of OneShotTimer that will execute its fire method at the expiration of the given time.
OneShotTimer(AbsoluteTime time, Clock clock, AsyncEventHandler handler)
          Create an instance of OneShotTimer, based on the given clock, that will execute its fire method at the expiration of the given time.
OneShotTimer(RelativeTime time, AsyncEventHandler handler)
          Create an instance of OneShotTimer that will execute its fire method at the expiration of the given time.
OneShotTimer(RelativeTime time, Clock clock, AsyncEventHandler handler)
          Create an instance of OneShotTimer, based on the given clock, that will execute its fire method at the expiration of the given time.
 
Method Summary
protected  javax.realtime.TimerImpl getTimerImpl()
          This method is implemented in subclasses.
 
Methods inherited from class javax.realtime.Timer
createReleaseParameters, destroy, disable, enable, getClock, getFireTime, isRunning, reschedule, 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
 

Constructor Detail

OneShotTimer

public OneShotTimer(AbsoluteTime time,
                    AsyncEventHandler handler)
Create an instance of OneShotTimer 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 AsyncEventHandler that will be scheduled when fire is executed.

OneShotTimer

public OneShotTimer(AbsoluteTime time,
                    Clock clock,
                    AsyncEventHandler handler)
Create an instance of OneShotTimer, based on the given clock, 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.
clock - The timer will increment based on this clock
handler - The AsyncEventHandler that will be scheduled when fire is executed.

OneShotTimer

public OneShotTimer(RelativeTime time,
                    AsyncEventHandler handler)
Create an instance of OneShotTimer 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 AsyncEventHandler that will be scheduled when fire is executed.

OneShotTimer

public OneShotTimer(RelativeTime time,
                    Clock clock,
                    AsyncEventHandler handler)
Create an instance of OneShotTimer, based on the given clock, 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.
clock - The timer will increment based on this clock
handler - The AsyncEventHandler that will be scheduled when fire is executed.
Method Detail

getTimerImpl

protected javax.realtime.TimerImpl getTimerImpl()
Description copied from class: Timer
This method is implemented in subclasses.

Specified by:
getTimerImpl in class Timer


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2005 Angelo Corsaro and Morgan Deters.