javax.realtime
Class OneShotTimer
java.lang.Object
javax.realtime.AsyncEvent
javax.realtime.Timer
javax.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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
oneShotTimerThread
protected OneShotTimerThread oneShotTimerThread
- This
OneShotTimer's
OneShotTimerThread
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 timerclock - the timer will increment based on this clockhandler - 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.
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 -