public interface ItsNatTimerHandle extends ItsNatUserData
ItsNatTimer
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancels this timer task.
|
long |
getFirstTime()
Returns the time, in the format returned by
Date.getTime() , at which
the task was (or is going to be) executed by the first time. |
ItsNatTimer |
getItsNatTimer()
Returns the timer manager this scheduled task belongs to.
|
long |
getPeriod()
Returns the time in milliseconds between successive task executions.
|
boolean |
isCancelled()
Informs whether this timer task is cancelled
|
long |
scheduledExecutionTime()
Returns the scheduled execution time of the most recent
actual execution of this task.
|
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
ItsNatTimer getItsNatTimer()
long getFirstTime()
Date.getTime()
, at which
the task was (or is going to be) executed by the first time.long getPeriod()
boolean cancel()
Note that calling this method from within the
EventListener.handleEvent(Event)
method of a repeating timer task absolutely guarantees that the timer task will
not run again.
This method may be called repeatedly; the second and subsequent calls have no effect.
Note: documentation copied (and slightly modified) from
java.util.TimerTask.cancel()
.
boolean isCancelled()
cancel()
long scheduledExecutionTime()
This method is typically invoked from within a task's
EventListener.handleEvent(Event)
method, to determine whether the current execution of the task is sufficiently
timely to warrant performing the scheduled activity:
public void run() { if (System.currentTimeMillis() - scheduledExecutionTime() >= MAX_TARDINESS) return; // Too late; skip this execution. // Perform the task }This method is typically not used in conjunction with fixed-delay execution repeating tasks, as their scheduled execution times are allowed to drift over time, and so are not terribly significant.
Note: documentation copied (and slightly modified) from
java.util.TimerTask.scheduledExecutionTime()
.
getFirstTime()
if the task has yet to commence
its first execution.Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.