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(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()
Return the cron expression defining when the task should be executed.
|
getTriggergetRunnable, toStringpublic CronTask(java.lang.Runnable runnable,
java.lang.String expression)
CronTask.runnable - the underlying task to executeexpression - the 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