org.springframework.scheduling.config

## Class TriggerTask

- java.lang.Object
- - org.springframework.scheduling.config.Task
  - - org.springframework.scheduling.config.TriggerTask

- Direct Known Subclasses:
    CronTask

      public class TriggerTask
      extends Task

  `Task` implementation defining a `Runnable` to be executed according to a given `Trigger`.
  Since:
    3.2
  Author:
    Chris Beams
  See Also:
    `Trigger.nextExecutionTime(org.springframework.scheduling.TriggerContext)`, `ScheduledTaskRegistrar.setTriggerTasksList(java.util.List)`, `TaskScheduler.schedule(Runnable, Trigger)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TriggerTask(Runnable runnable, Trigger trigger)` Create a new `TriggerTask`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Trigger` | `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

    - #### TriggerTask

          public TriggerTask(Runnable runnable,
                     Trigger trigger)

      Create a new `TriggerTask`.
      Parameters:
        `runnable` - the underlying task to execute
        `trigger` - specifies when the task should be executed

  - ### Method Detail

    - #### getTrigger

          public Trigger getTrigger()