Class IntervalTask
java.lang.Object
org.springframework.scheduling.config.Task
org.springframework.scheduling.config.DelayedTask
org.springframework.scheduling.config.IntervalTask
- Direct Known Subclasses:
- FixedDelayTask,- FixedRateTask
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.- Since:
- 3.2
- Author:
- Chris Beams, Arjen Poutsma
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionIntervalTask(Runnable runnable, long interval) Deprecated.IntervalTask(Runnable runnable, long interval, long initialDelay) Deprecated.as of 6.0, in favor onIntervalTask(Runnable, Duration, Duration)IntervalTask(Runnable runnable, Duration interval) Create a newIntervalTaskwith no initial delay.IntervalTask(Runnable runnable, Duration interval, Duration initialDelay) Create a newIntervalTask.
- 
Method SummaryModifier and TypeMethodDescriptionlongDeprecated.as of 6.0, in favor ofgetInitialDelayDuration()Return the initial delay before first execution of the task.longDeprecated.as of 6.0, in favor ofgetIntervalDuration()Return how often the task should be executed.Methods inherited from class org.springframework.scheduling.config.TaskgetLastExecutionOutcome, getRunnable, toString
- 
Constructor Details- 
IntervalTaskDeprecated.as of 6.0, in favor onIntervalTask(Runnable, Duration, Duration)Create a newIntervalTask.- Parameters:
- runnable- the underlying task to execute
- interval- how often in milliseconds the task should be executed
- initialDelay- the initial delay before first execution of the task
 
- 
IntervalTaskDeprecated.as of 6.0, in favor onIntervalTask(Runnable, Duration)Create a newIntervalTaskwith no initial delay.- Parameters:
- runnable- the underlying task to execute
- interval- how often in milliseconds the task should be executed
 
- 
IntervalTaskCreate a newIntervalTaskwith no initial delay.- Parameters:
- runnable- the underlying task to execute
- interval- how often the task should be executed
- Since:
- 6.0
 
- 
IntervalTaskCreate a newIntervalTask.- Parameters:
- runnable- the underlying task to execute
- interval- how often the task should be executed
- initialDelay- the initial delay before first execution of the task
- Since:
- 6.0
 
 
- 
- 
Method Details- 
getIntervalDeprecated.as of 6.0, in favor ofgetIntervalDuration()Return how often in milliseconds the task should be executed.
- 
getIntervalDurationReturn how often the task should be executed.- Since:
- 6.0
 
- 
getInitialDelayDeprecated.as of 6.0, in favor ofgetInitialDelayDuration()Return the initial delay before first execution of the task.
- 
getInitialDelayDurationReturn the initial delay before first execution of the task.- Overrides:
- getInitialDelayDurationin class- DelayedTask
- Since:
- 6.0
 
 
- 
IntervalTask(Runnable, Duration)