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 the TriggerContext interface.
Since:
3.0
Author:
Juergen Hoeller
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a SimpleTriggerContext with all time values set to null, exposing the system clock for the default time zone.
    Create a SimpleTriggerContext with all time values set to null, 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 Type
    Method
    Description
    Return the clock to use for trigger calculation.
    Return the last actual execution time of the task, or null if not scheduled before.
    Return the last completion time of the task, or null if not scheduled before.
    Return the last scheduled execution time of the task, or null if not scheduled before.
    void
    update(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime)
    Update this holder's state with the latest time values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleTriggerContext

      public SimpleTriggerContext()
      Create a SimpleTriggerContext with all time values set to null, 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 time
      lastActualExecutionTime - last actual execution time
      lastCompletionTime - last completion time
    • SimpleTriggerContext

      public SimpleTriggerContext(Clock clock)
      Create a SimpleTriggerContext with all time values set to null, exposing the given clock.
      Parameters:
      clock - the clock to use for trigger calculation
      Since:
      5.3
      See Also:
  • Method Details