public class TimerScheduler
extends java.lang.Object
Timer
which does not have the
disadvantage of Timer
to always create its thread at
construction time. It also allows the currently scheduled
TimerTask
s to be canceled while still being able to schedule new
TimerTask
s later on.Constructor and Description |
---|
TimerScheduler() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Discarding any currently scheduled
TimerTask s. |
void |
schedule(java.util.TimerTask task,
long delay)
Schedules the specified
TimerTask for execution after the
specified delay. |
void |
schedule(java.util.TimerTask task,
long delay,
long period)
Schedules the specified
TimerTask for repeated fixed-delay
execution, beginning after the specified delay. |
public void cancel()
TimerTask
s.public void schedule(java.util.TimerTask task, long delay)
TimerTask
for execution after the
specified delay.task
- the TimerTask
to be executed after the specified
delaydelay
- the delay in milliseconds before the specified
TimerTask
is executedpublic void schedule(java.util.TimerTask task, long delay, long period)
TimerTask
for repeated fixed-delay
execution, beginning after the specified delay. Subsequent executions
take place at approximately regular intervals separated by the specified
period.task
- the TimerTask
to be scheduleddelay
- the delay in milliseconds before the specified
TimerTask
is executedperiod
- the time in milliseconds between successive executions of the
specified TimerTask
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.