Class SimpleTriggerContext
- java.lang.Object
- org.springframework.scheduling.support.SimpleTriggerContext
- All Implemented Interfaces:
TriggerContext
public class SimpleTriggerContext extends Object implements TriggerContext
Simple data holder implementation of theTriggerContext
interface.- Since:
- 3.0
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description SimpleTriggerContext()
Create a SimpleTriggerContext with all time values set tonull
.SimpleTriggerContext(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime)
Create a SimpleTriggerContext with the given time values.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Date
lastActualExecutionTime()
Return the last actual execution time of the task, ornull
if not scheduled before.Date
lastCompletionTime()
Return the last completion time of the task, ornull
if not scheduled before.Date
lastScheduledExecutionTime()
Return the last scheduled execution time of the task, ornull
if not scheduled before.void
update(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime)
Update this holder's state with the latest time values.
Constructor Detail
SimpleTriggerContext
public SimpleTriggerContext()
Create a SimpleTriggerContext with all time values set tonull
.
SimpleTriggerContext
public SimpleTriggerContext(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime)
Create a SimpleTriggerContext with the given time values.- Parameters:
lastScheduledExecutionTime
- last scheduled execution timelastActualExecutionTime
- last actual execution timelastCompletionTime
- last completion time
Method Detail
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
lastScheduledExecutionTime
@Nullable public Date lastScheduledExecutionTime()
Description copied from interface:TriggerContext
Return the last scheduled execution time of the task, ornull
if not scheduled before.- Specified by:
lastScheduledExecutionTime
in interfaceTriggerContext
lastActualExecutionTime
@Nullable public Date lastActualExecutionTime()
Description copied from interface:TriggerContext
Return the last actual execution time of the task, ornull
if not scheduled before.- Specified by:
lastActualExecutionTime
in interfaceTriggerContext
lastCompletionTime
@Nullable public Date lastCompletionTime()
Description copied from interface:TriggerContext
Return the last completion time of the task, ornull
if not scheduled before.- Specified by:
lastCompletionTime
in interfaceTriggerContext