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