oracle.bali.share.thread
Class Periodic
java.lang.Object
|
+--oracle.bali.share.thread.Timer
|
+--oracle.bali.share.thread.Periodic
- All Implemented Interfaces:
- java.lang.Runnable
- public class Periodic
- extends Timer
A Periodic is a subclass of Timer that behaves identically
to a Timer but automatically reschedules itself after every
run until it is explicitly cancelled with the cancel() method.
Periodics may be rescheduled or cancelled at any point, but they are not
destroyed until the kill() method is explicitly called.
Constructor Summary |
Periodic(java.lang.Runnable target)
Constructs a new Periodic for the specified target. |
Periodic(java.lang.Runnable target,
long delay)
Constructs a new periodic for the specified target,
immediately starting it running. |
Periodic(java.lang.Runnable target,
java.lang.String name)
Constructs a new Periodic for the specified target,
with a given name. |
Method Summary |
protected void |
doRun()
Runs the target (by calling the superclasses doRun(),
then automatically reschedules itself. |
protected java.lang.String |
getDefaultName()
Returns the default name for the periodic. |
Methods inherited from class oracle.bali.share.thread.Timer |
accurateSleep, cancel, finalize, getDelay, getMillisSinceExpired, getName, getPriority, isDaemon, isKilled, isScheduled, kill, run, schedule, setDaemon, setDelay, setName, setPriority, wasCancelledDuringRun |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Periodic
public Periodic(java.lang.Runnable target)
- Constructs a new Periodic for the specified target.
The Periodic doesn't run until it is scheduled.
Periodic
public Periodic(java.lang.Runnable target,
java.lang.String name)
- Constructs a new Periodic for the specified target,
with a given name. The Periodic doesn't run until it is scheduled.
Periodic
public Periodic(java.lang.Runnable target,
long delay)
- Constructs a new periodic for the specified target,
immediately starting it running.
doRun
protected void doRun()
- Runs the target (by calling the superclasses doRun(),
then automatically reschedules itself.
- Overrides:
doRun
in class Timer
getDefaultName
protected java.lang.String getDefaultName()
- Returns the default name for the periodic.
- Overrides:
getDefaultName
in class Timer