public abstract class Task
extends java.util.TimerTask
Modifier and Type | Field and Description |
---|---|
java.lang.String |
id
The unique task identifier.
|
long |
lastExecutionTime
The last execution time (in milliseconds since Epoch) of the
task.
|
long |
nextExecutionTime
The next scheduled execution time (in milliseconds since
Epoch) of the task.
|
long |
schedulerPeriod
The recurring scheduler period.
|
Constructor and Description |
---|
Task(java.lang.String id)
Creates a new scheduler task with the provided unique id.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancels this scheduled task.
|
abstract void |
execute()
Executes this task.
|
void |
run()
Executes this task and updates the scheduling timers.
|
public java.lang.String id
public long lastExecutionTime
public long nextExecutionTime
public long schedulerPeriod
public Task(java.lang.String id)
id
- the unique task identifierpublic final void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
public abstract void execute() throws java.lang.Exception
java.lang.Exception
- if an error occurred during the executionpublic boolean cancel()
cancel
in class java.util.TimerTask