public class IntervalTask extends Task
Task implementation defining a Runnable to be executed at a given
millisecond interval which may be treated as fixed-rate or fixed-delay depending on
context.Scheduled.fixedRate(),
Scheduled.fixedDelay(),
ScheduledTaskRegistrar.setFixedRateTasksList(java.util.List),
ScheduledTaskRegistrar.setFixedDelayTasksList(java.util.List),
TaskScheduler| Constructor and Description |
|---|
IntervalTask(java.lang.Runnable runnable,
long interval)
Create a new
IntervalTask with no initial delay. |
IntervalTask(java.lang.Runnable runnable,
long interval,
long initialDelay)
Create a new
IntervalTask. |
| Modifier and Type | Method and Description |
|---|---|
long |
getInitialDelay() |
long |
getInterval() |
getRunnablepublic IntervalTask(java.lang.Runnable runnable,
long interval,
long initialDelay)
IntervalTask.runnable - the underlying task to executeinterval - how often in milliseconds the task should be executedinitialDelay - initial delay before first execution of the taskpublic IntervalTask(java.lang.Runnable runnable,
long interval)
IntervalTask with no initial delay.runnable - the underlying task to executeinterval - how often in milliseconds the task should be executed