Class CronTask
- java.lang.Object
- org.springframework.scheduling.config.Task
- org.springframework.scheduling.config.TriggerTask
- org.springframework.scheduling.config.CronTask
public class CronTask extends TriggerTask
TriggerTask
implementation defining aRunnable
to be executed according to a standard cron expression.- Since:
- 3.2
- Author:
- Chris Beams
- See Also:
Scheduled.cron()
,ScheduledTaskRegistrar.setCronTasksList(java.util.List)
,TaskScheduler
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getExpression()
Methods inherited from class org.springframework.scheduling.config.TriggerTask
getTrigger
Methods inherited from class org.springframework.scheduling.config.Task
getRunnable
Constructor Detail
CronTask
public CronTask(Runnable runnable, String expression)
Create a newCronTask
.- Parameters:
runnable
- the underlying task to executeexpression
- cron expression defining when the task should be executed
CronTask
public CronTask(Runnable runnable, CronTrigger cronTrigger)
Create a newCronTask
.- Parameters:
runnable
- the underlying task to executecronTrigger
- the cron trigger defining when the task should be executed
Method Detail
getExpression
public String getExpression()