public final class Timer extends Object implements Serializable
The class methods are properly synchronized to safely allow multi-thread, and remote access.
Note: as with the Scheduler class, this class also supports serialisation. Therefore, in order for the serialisation to succeed, each of the loaded tasks must also be serialisable.
| Constructor and Description |
|---|
Timer(Scheduler sched)
The constructor loads the timer into the Scheduler, but does not yet
start it running.
|
| Modifier and Type | Method and Description |
|---|---|
void |
load(Object task,
long interval,
int count)
This method loads a task for timed execution.
|
void |
remove(Object task)
This method prematurely removes a task from the timed execution queue.
|
void |
slice()
The timer task implementation itself, invoked by the scheduler.
|
public Timer(Scheduler sched)
sched - The scheduler to use for execution.public void load(Object task, long interval, int count)
task - The operation to be timed, it can be local, remote, or even
a proxy, when enabled.interval - The time between execution, in millisecondscount - The number of times to run before removal, a count of zero
indicates to run indefinitely, or until removedpublic void remove(Object task)
task - The task to discardpublic void slice()
Copyright © 2016. All Rights Reserved.