Top Description Fields Constructors Methods
org.springframework.scheduling.config

public Class CronTask

extends TriggerTask
Class Inheritance
Imports
org.springframework.scheduling.support.CronTrigger

TriggerTask implementation defining a Runnable to be executed according to a standard cron expression.
Author
Chris Beams
Since
3.2
See Also
org.springframework.scheduling.annotation.Scheduled#cron(), ScheduledTaskRegistrar#addCronTask(CronTask)

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
CronTask(Runnable
the underlying task to execute
runnable
,
String
the cron expression defining when the task should be executed
expression
)

Create a new CronTask.

public
CronTask(Runnable
the underlying task to execute
runnable
,
CronTrigger
the cron trigger defining when the task should be executed
cronTrigger
)

Create a new CronTask.

Method Summary

Modifier and TypeMethod and Description
public String
getExpression()

Return the cron expression defining when the task should be executed.

Inherited from org.springframework.scheduling.config.TriggerTask:
getTrigger

Field Detail

expressionback to summary
private final String expression

Constructor Detail

CronTaskback to summary
public CronTask(Runnable runnable, String expression)

Create a new CronTask.

Parameters
runnable:Runnable

the underlying task to execute

expression:String

the cron expression defining when the task should be executed

CronTaskback to summary
public CronTask(Runnable runnable, CronTrigger cronTrigger)

Create a new CronTask.

Parameters
runnable:Runnable

the underlying task to execute

cronTrigger:CronTrigger

the cron trigger defining when the task should be executed

Method Detail

getExpressionback to summary
public String getExpression()

Return the cron expression defining when the task should be executed.