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|
The constructor loads the timer into the Scheduler, but does not yet start it running.
|Modifier and Type||Method and Description|
This method loads a task for timed execution.
This method prematurely removes a task from the timed execution queue.
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 milliseconds
count- The number of times to run before removal, a count of zero indicates to run indefinitely, or until removed
public void remove(Object task)
task- The task to discard
public void slice()
Copyright © 2016. All Rights Reserved.