Class IntervalTask
- java.lang.Object
- org.springframework.scheduling.config.Task
- org.springframework.scheduling.config.IntervalTask
public class IntervalTask extends Task
Taskimplementation defining aRunnableto be executed at a given millisecond interval which may be treated as fixed-rate or fixed-delay depending on context.
Constructor Summary
Constructors Constructor Description IntervalTask(Runnable runnable, long interval)Create a newIntervalTaskwith no initial delay.IntervalTask(Runnable runnable, long interval, long initialDelay)Create a newIntervalTask.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetInitialDelay()longgetInterval()Methods inherited from class org.springframework.scheduling.config.Task
getRunnable
Constructor Detail
IntervalTask
public IntervalTask(Runnable runnable, long interval, long initialDelay)
Create a newIntervalTask.- Parameters:
runnable- the underlying task to executeinterval- how often in milliseconds the task should be executedinitialDelay- initial delay before first execution of the task
IntervalTask
public IntervalTask(Runnable runnable, long interval)
Create a newIntervalTaskwith no initial delay.- Parameters:
runnable- the underlying task to executeinterval- how often in milliseconds the task should be executed
Method Detail
getInterval
public long getInterval()
getInitialDelay
public long getInitialDelay()