dsto.dfc.util
Class Scheduler.Task
java.lang.Object
dsto.dfc.util.Scheduler.Task
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- DataObjectPersister2, DataObjectPersister2.CleanupTask, EntityContainer.EmitNotificationTask, PropertyChangeTask, TaskDelegate
- Enclosing class:
- Scheduler
public abstract static class Scheduler.Task
- extends Object
- implements Runnable
Base class for tasks that can be scheduled.
Field Summary |
protected long |
runAt
Time that task will next be run. |
protected Scheduler |
scheduler
The scheduler instance running the task. |
Method Summary |
void |
dispose()
Called when the task is in the scheduling queue (but not currently
running) and the scheduler is being shut down. |
abstract void |
run()
|
boolean |
scheduled()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
runAt
protected long runAt
- Time that task will next be run. 0 => not currently scheduled.
scheduler
protected Scheduler scheduler
- The scheduler instance running the task. Only valid during run () and
dispose ().
Scheduler.Task
public Scheduler.Task()
run
public abstract void run()
- Specified by:
run
in interface Runnable
dispose
public void dispose()
- Called when the task is in the scheduling queue (but not currently
running) and the scheduler is being shut down. After this has been
called, the task will not get another chance to run in the current
scheduler.
The default implementation calls run () if the task is scheduled to be
run now, does nothing if not. Subclasses may override as needed.
scheduled
public final boolean scheduled()
Copyright © 2008 Commonwealth of Australia