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 Summary
ConstructorsConstructorDescriptionCreate a SimpleTriggerContext with all time values set tonull, 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(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime) Create a SimpleTriggerContext with the given time values, exposing the system clock for the default time zone. -
Method Summary
Modifier 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 this holder's state with the latest time values.
-
Constructor Details
-
SimpleTriggerContext
public SimpleTriggerContext()Create a SimpleTriggerContext with all time values set tonull, exposing the system clock for the default time zone. -
SimpleTriggerContext
public SimpleTriggerContext(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime) Create a SimpleTriggerContext with the given time values, exposing the system clock for the default time zone.- Parameters:
lastScheduledExecutionTime- last scheduled execution timelastActualExecutionTime- last actual execution timelastCompletionTime- last completion time
-
SimpleTriggerContext
Create 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
public void update(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime) Update this holder's state with the latest time values.- Parameters:
lastScheduledExecutionTime- last scheduled execution timelastActualExecutionTime- last actual execution timelastCompletionTime- last completion time
-
getClock
Description copied from interface:TriggerContextReturn the clock to use for trigger calculation.- Specified by:
getClockin interfaceTriggerContext- See Also:
-
lastScheduledExecutionTime
Description copied from interface:TriggerContextReturn the last scheduled execution time of the task, ornullif not scheduled before.- Specified by:
lastScheduledExecutionTimein interfaceTriggerContext
-
lastActualExecutionTime
Description copied from interface:TriggerContextReturn the last actual execution time of the task, ornullif not scheduled before.- Specified by:
lastActualExecutionTimein interfaceTriggerContext
-
lastCompletionTime
Description copied from interface:TriggerContextReturn the last completion time of the task, ornullif not scheduled before.- Specified by:
lastCompletionTimein interfaceTriggerContext
-