org.springframework.scheduling.support

Class CronTrigger

  • java.lang.Object
    • org.springframework.scheduling.support.CronTrigger
    • Constructor Summary

      Constructors 
      Constructor and Description
      CronTrigger(java.lang.String expression)
      Build a CronTrigger from the pattern provided in the default time zone.
      CronTrigger(java.lang.String expression, java.util.TimeZone timeZone)
      Build a CronTrigger from the pattern provided in the given time zone.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object other) 
      java.lang.String getExpression()
      Return the cron pattern that this trigger has been built with.
      int hashCode() 
      java.util.Date nextExecutionTime(TriggerContext triggerContext)
      Determine the next execution time according to the given trigger context.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CronTrigger

        public CronTrigger(java.lang.String expression)
        Build a CronTrigger from the pattern provided in the default time zone.
        Parameters:
        expression - a space-separated list of time fields, following cron expression conventions
      • CronTrigger

        public CronTrigger(java.lang.String expression,
                           java.util.TimeZone timeZone)
        Build a CronTrigger from the pattern provided in the given time zone.
        Parameters:
        expression - a space-separated list of time fields, following cron expression conventions
        timeZone - a time zone in which the trigger times will be generated
    • Method Detail

      • getExpression

        public java.lang.String getExpression()
        Return the cron pattern that this trigger has been built with.
      • nextExecutionTime

        public java.util.Date nextExecutionTime(TriggerContext triggerContext)
        Determine the next execution time according to the given trigger context.

        Next execution times are calculated based on the completion time of the previous execution; therefore, overlapping executions won't occur.

        Specified by:
        nextExecutionTime in interface Trigger
        Parameters:
        triggerContext - context object encapsulating last execution times and last completion time
        Returns:
        the next execution time as defined by the trigger, or null if the trigger won't fire anymore
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object