类 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.- 从以下版本开始:
- 3.2
- 作者:
- Chris Beams
- 另请参阅:
Scheduled.cron()
,ScheduledTaskRegistrar.addCronTask(CronTask)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getExpression()
Return the cron expression defining when the task should be executed.从类继承的方法 org.springframework.scheduling.config.TriggerTask
getTrigger
从类继承的方法 org.springframework.scheduling.config.Task
getRunnable, toString
构造器详细资料
CronTask
public CronTask(Runnable runnable, String expression)
Create a newCronTask
.- 参数:
runnable
- the underlying task to executeexpression
- the cron expression defining when the task should be executed
CronTask
public CronTask(Runnable runnable, CronTrigger cronTrigger)
Create a newCronTask
.- 参数:
runnable
- the underlying task to executecronTrigger
- the cron trigger defining when the task should be executed
方法详细资料
getExpression
public String getExpression()
Return the cron expression defining when the task should be executed.