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
ConstructorDescriptionIntervalTask
(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 newIntervalTask
with no initial delay.IntervalTask
(Runnable runnable, Duration interval, Duration initialDelay) Create a newIntervalTask
. -
Method Summary
Modifier and TypeMethodDescriptionlong
Deprecated.as of 6.0, in favor ofgetInitialDelayDuration()
Return the initial delay before first execution of the task.long
Deprecated.as of 6.0, in favor ofgetIntervalDuration()
Return how often the task should be executed.Methods inherited from class org.springframework.scheduling.config.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 newIntervalTask
with no initial delay.- Parameters:
runnable
- the underlying task to executeinterval
- how often in milliseconds the task should be executed
-
IntervalTask
Create a newIntervalTask
with no initial delay.- Parameters:
runnable
- the underlying task to executeinterval
- how often the task should be executed- Since:
- 6.0
-
IntervalTask
Create a newIntervalTask
.- Parameters:
runnable
- the underlying task to executeinterval
- how often the task should be executedinitialDelay
- the initial delay before first execution of the task- Since:
- 6.0
-
-
Method Details
-
getInterval
Deprecated.as of 6.0, in favor ofgetIntervalDuration()
Return how often in milliseconds the task should be executed. -
getIntervalDuration
Return how often the task should be executed.- Since:
- 6.0
-
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:
getInitialDelayDuration
in classDelayedTask
- Since:
- 6.0
-
IntervalTask(Runnable, Duration)