public class CronTask extends TriggerTask
TriggerTask
implementation defining a Runnable
to be executed according
to a standard cron expression.Scheduled.cron()
,
ScheduledTaskRegistrar.addCronTask(CronTask)
Constructor and Description |
---|
CronTask(Runnable runnable,
CronTrigger cronTrigger)
Create a new
CronTask . |
CronTask(Runnable runnable,
String expression)
Create a new
CronTask . |
Modifier and Type | Method and Description |
---|---|
String |
getExpression()
Return the cron expression defining when the task should be executed.
|
getTrigger
getRunnable, toString
public CronTask(Runnable runnable, String expression)
CronTask
.runnable
- the underlying task to executeexpression
- the cron expression defining when the task should be executedpublic CronTask(Runnable runnable, CronTrigger cronTrigger)
CronTask
.runnable
- the underlying task to executecronTrigger
- the cron trigger defining when the task should be executedpublic String getExpression()