Class SimpleTriggerContext
java.lang.Object
org.springframework.scheduling.support.SimpleTriggerContext
- All Implemented Interfaces:
- TriggerContext
Simple data holder implementation of the 
TriggerContext interface.- Since:
- 3.0
- Author:
- Juergen Hoeller
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a SimpleTriggerContext with all time values set tonull, exposing the system clock for the default time zone.SimpleTriggerContext(@Nullable Instant lastScheduledExecution, @Nullable Instant lastActualExecution, @Nullable Instant lastCompletion) Create a SimpleTriggerContext with the given time values, exposing the system clock for the default time zone.SimpleTriggerContext(Clock clock) Create a SimpleTriggerContext with all time values set tonull, exposing the given clock.SimpleTriggerContext(@Nullable Date lastScheduledExecutionTime, @Nullable Date lastActualExecutionTime, @Nullable Date lastCompletionTime) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptiongetClock()Return the clock to use for trigger calculation.Return the last actual execution time of the task, ornullif not scheduled before.Return the last completion time of the task, ornullif not scheduled before.Return the last scheduled execution time of the task, ornullif not scheduled before.voidupdate(@Nullable Instant lastScheduledExecution, @Nullable Instant lastActualExecution, @Nullable Instant lastCompletion) Update this holder's state with the latest time values.voidupdate(@Nullable Date lastScheduledExecutionTime, @Nullable Date lastActualExecutionTime, @Nullable Date lastCompletionTime) Deprecated.as of 6.0, in favor ofupdate(Instant, Instant, Instant)Methods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TriggerContextlastActualExecutionTime, lastCompletionTime, lastScheduledExecutionTime
- 
Constructor Details- 
SimpleTriggerContextpublic SimpleTriggerContext()Create a SimpleTriggerContext with all time values set tonull, exposing the system clock for the default time zone.
- 
SimpleTriggerContext@Deprecated(since="6.0") public SimpleTriggerContext(@Nullable Date lastScheduledExecutionTime, @Nullable Date lastActualExecutionTime, @Nullable Date lastCompletionTime) Deprecated.as of 6.0, in favor ofSimpleTriggerContext(Instant, Instant, Instant)Create a SimpleTriggerContext with the given time values, exposing the system clock for the default time zone.- Parameters:
- lastScheduledExecutionTime- last scheduled execution time
- lastActualExecutionTime- last actual execution time
- lastCompletionTime- last completion time
 
- 
SimpleTriggerContextpublic SimpleTriggerContext(@Nullable Instant lastScheduledExecution, @Nullable Instant lastActualExecution, @Nullable Instant lastCompletion) Create a SimpleTriggerContext with the given time values, exposing the system clock for the default time zone.- Parameters:
- lastScheduledExecution- last scheduled execution time
- lastActualExecution- last actual execution time
- lastCompletion- last completion time
 
- 
SimpleTriggerContextCreate a SimpleTriggerContext with all time values set tonull, exposing the given clock.- Parameters:
- clock- the clock to use for trigger calculation
- Since:
- 5.3
- See Also:
 
 
- 
- 
Method Details- 
update@Deprecated(since="6.0") public void update(@Nullable Date lastScheduledExecutionTime, @Nullable Date lastActualExecutionTime, @Nullable Date lastCompletionTime) Deprecated.as of 6.0, in favor ofupdate(Instant, Instant, Instant)Update this holder's state with the latest time values.- Parameters:
- lastScheduledExecutionTime- last scheduled execution time
- lastActualExecutionTime- last actual execution time
- lastCompletionTime- last completion time
 
- 
updatepublic void update(@Nullable Instant lastScheduledExecution, @Nullable Instant lastActualExecution, @Nullable Instant lastCompletion) Update this holder's state with the latest time values.- Parameters:
- lastScheduledExecution- last scheduled execution time
- lastActualExecution- last actual execution time
- lastCompletion- last completion time
 
- 
getClockDescription copied from interface:TriggerContextReturn the clock to use for trigger calculation.Defaults to Clock.systemDefaultZone().- Specified by:
- getClockin interface- TriggerContext
- See Also:
 
- 
lastScheduledExecutionDescription copied from interface:TriggerContextReturn the last scheduled execution time of the task, ornullif not scheduled before.- Specified by:
- lastScheduledExecutionin interface- TriggerContext
 
- 
lastActualExecutionDescription copied from interface:TriggerContextReturn the last actual execution time of the task, ornullif not scheduled before.- Specified by:
- lastActualExecutionin interface- TriggerContext
 
- 
lastCompletionDescription copied from interface:TriggerContextReturn the last completion time of the task, ornullif not scheduled before.- Specified by:
- lastCompletionin interface- TriggerContext
 
 
- 
SimpleTriggerContext(Instant, Instant, Instant)