|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.softwareag.tamino.db.api.common.TReschedulableTask
public abstract class TReschedulableTask
A task that can be scheduled and rescheduled for one-time or repeated execution by a TReschedulableTimer.
This class looks and smells like the java.util.TimerTask
class. But this time task may be
rescheduled when used with the TReschedulableTimer
class.
TimerTask
Constructor Summary | |
---|---|
TReschedulableTask()
Creates a new timer task. |
Method Summary | |
---|---|
boolean |
cancel()
Cancels this reschedulable task. |
abstract void |
run()
The action to be performed by this timer task. |
long |
scheduledExecutionTimeMillis()
Returns the scheduled execution time of the most recent actual execution of this task. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TReschedulableTask()
Method Detail |
---|
public boolean cancel()
Note that calling this method from within the run 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.
public long scheduledExecutionTimeMillis()
This method is typically invoked from within a task's run 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.
Date#getTime()
public abstract void run()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |