Class IntervalTask
java.lang.Object
org.springframework.scheduling.config.Task
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
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionIntervalTask(Runnable runnable, long interval) Create a newIntervalTaskwith no initial delay.IntervalTask(Runnable runnable, long interval, long initialDelay) Create a newIntervalTask.
- 
Method SummaryModifier and TypeMethodDescriptionlongReturn the initial delay before first execution of the task.longReturn how often in milliseconds the task should be executed.Methods inherited from class org.springframework.scheduling.config.TaskgetRunnable, toString
- 
Constructor Details- 
IntervalTaskCreate 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
 
- 
IntervalTaskCreate a newIntervalTaskwith no initial delay.- Parameters:
- runnable- the underlying task to execute
- interval- how often in milliseconds the task should be executed
 
 
- 
- 
Method Details- 
getIntervalpublic long getInterval()Return how often in milliseconds the task should be executed.
- 
getInitialDelaypublic long getInitialDelay()Return the initial delay before first execution of the task.
 
-