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 Summary
ConstructorsConstructorDescriptionIntervalTask(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 Summary
Modifier 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 Task
getLastExecutionOutcome, getRunnable, toString
-
Constructor Details
-
IntervalTask
Deprecated.as of 6.0, in favor onIntervalTask(Runnable, Duration, Duration)Create a newIntervalTask.- Parameters:
runnable- the underlying task to executeinterval- how often in milliseconds the task should be executedinitialDelay- the initial delay before first execution of the task
-
IntervalTask
Deprecated.as of 6.0, in favor onIntervalTask(Runnable, Duration)Create a newIntervalTaskwith no initial delay.- Parameters:
runnable- the underlying task to executeinterval- how often in milliseconds the task should be executed
-
IntervalTask
-
IntervalTask
-
-
Method Details
-
getInterval
Deprecated.as of 6.0, in favor ofgetIntervalDuration()Return how often in milliseconds the task should be executed. -
getIntervalDuration
-
getInitialDelay
Deprecated.as of 6.0, in favor ofgetInitialDelayDuration()Return the initial delay before first execution of the task. -
getInitialDelayDuration
Return the initial delay before first execution of the task.- Overrides:
getInitialDelayDurationin classDelayedTask- Since:
- 6.0
-
IntervalTask(Runnable, Duration)