Top Description Methods
org.springframework.scheduling

public Interface Trigger

Known Direct Implementers
org.springframework.scheduling.support.CronTrigger, org.springframework.scheduling.support.PeriodicTrigger
Imports
java.time.Instant, java.util.Date, org.springframework.lang.Nullable

Common interface for trigger objects that determine the next execution time of a task that they get associated with.
Author
Juergen Hoeller
Since
3.0
See Also
TaskScheduler#schedule(Runnable, Trigger), org.springframework.scheduling.support.CronTrigger

Method Summary

Modifier and TypeMethod and Description
public Instant

Returns:

the next execution time as defined by the trigger, or null if the trigger won't fire anymore
nextExecution
(TriggerContext
context object encapsulating last execution times and last completion time
triggerContext
)

Determine the next execution time according to the given trigger context.

public default Date

Returns:

the next execution time as defined by the trigger, or null if the trigger won't fire anymore
nextExecutionTime
(TriggerContext
context object encapsulating last execution times and last completion time
triggerContext
)
Deprecated since 6.0. as of 6.0, in favor of nextExecution(TriggerContext)

Determine the next execution time according to the given trigger context.

Method Detail

nextExecutionback to summary
public Instant nextExecution(TriggerContext triggerContext)

Determine the next execution time according to the given trigger context.

Parameters
triggerContext:TriggerContext

context object encapsulating last execution times and last completion time

Returns:Instant

the next execution time as defined by the trigger, or null if the trigger won't fire anymore

Annotations
@Nullable
Since
6.0
nextExecutionTimeback to summary
public default Date nextExecutionTime(TriggerContext triggerContext)

Deprecated

since 6.0.

as of 6.0, in favor of nextExecution(TriggerContext)

Determine the next execution time according to the given trigger context.

The default implementation delegates to nextExecution(TriggerContext).

Parameters
triggerContext:TriggerContext

context object encapsulating last execution times and last completion time

Returns:Date

the next execution time as defined by the trigger, or null if the trigger won't fire anymore

Annotations
@Deprecated
since:6.0
@Nullable