Package 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:
  - `ScheduledTaskRegistrar.addTriggerTask(TriggerTask)`
  - `TaskScheduler.schedule(Runnable, Trigger)`

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`Trigger`
`getTrigger()`
Return the associated trigger.

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

`getLastExecutionOutcome, getRunnable, toString`

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

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

## Constructor Details

### 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 Details

### getTrigger

public Trigger getTrigger()
Return the associated trigger.