org.springframework.scheduling.config

## Class 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 a `Runnable` to be executed according to a standard cron expression.

Since:
  3.2
Author:
  Chris Beams
See Also:
  `Scheduled.cron()`, `ScheduledTaskRegistrar.setCronTasksList(java.util.List)`, `TaskScheduler`

### Constructor Summary

Constructors
Constructor and Description
`CronTask(Runnable runnable, CronTrigger cronTrigger)` Create a new `CronTask`.
`CronTask(Runnable runnable, String expression)` Create a new `CronTask`.

### Method Summary

Methods
`String` `getExpression()`

### Methods inherited from class org.springframework.scheduling.config.TriggerTask

`getTrigger`

### Methods inherited from class org.springframework.scheduling.config.Task

`getRunnable`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CronTask

    public CronTask(Runnable runnable,
            String expression)

Create a new `CronTask`.

Parameters:
  `runnable` - the underlying task to execute
  `expression` - cron expression defining when the task should be executed

#### CronTask

    public CronTask(Runnable runnable,
            CronTrigger cronTrigger)

Create a new `CronTask`.

Parameters:
  `runnable` - the underlying task to execute
  `cronTrigger` - the cron trigger defining when the task should be executed

### Method Detail

#### getExpression

    public String getExpression()