Class CronTrigger

java.lang.Object
org.drools.core.time.impl.CronTrigger
All Implemented Interfaces:
Serializable, Trigger

public class CronTrigger extends Object implements Trigger
See Also:
  • Field Details

    • YEAR_TO_GIVEUP_SCHEDULING_AT

      protected static final int YEAR_TO_GIVEUP_SCHEDULING_AT
      See Also:
  • Constructor Details

    • CronTrigger

      public CronTrigger()
    • CronTrigger

      public CronTrigger(long timestamp, Date startTime, Date endTime, int repeatLimit, String cronExpression, String[] calendarNames, Calendars calendars)
    • CronTrigger

      public CronTrigger(long timestamp, Date startTime, Date endTime, int repeatLimit, CronExpression cronExpression, String[] calendarNames, Calendars calendars)
  • Method Details

    • getStartTime

      public Date getStartTime()
    • setStartTime

      public void setStartTime(Date startTime)
    • getEndTime

      public Date getEndTime()

      Get the time at which the CronTrigger should quit repeating - even if repeastCount isn't yet satisfied.

    • setEndTime

      public void setEndTime(Date endTime)
    • getNextFireTime

      public Date getNextFireTime()

      Returns the next time at which the Trigger is scheduled to fire. If the trigger will not fire again, null will be returned. Note that the time returned can possibly be in the past, if the time that was computed for the trigger to next fire has already arrived, but the scheduler has not yet been able to fire the trigger (which would likely be due to lack of resources e.g. threads).

      The value returned is not guaranteed to be valid until after the Trigger has been added to the scheduler.

    • getPreviousFireTime

      public Date getPreviousFireTime()

      Returns the previous time at which the CronTrigger fired. If the trigger has not yet fired, null will be returned.

    • setNextFireTime

      public void setNextFireTime(Date nextFireTime)

      Sets the next time at which the CronTrigger will fire. This method should not be invoked by client code.

    • setPreviousFireTime

      public void setPreviousFireTime(Date previousFireTime)

      Set the previous time at which the CronTrigger fired.

      This method should not be invoked by client code.

    • getTimeZone

      public TimeZone getTimeZone()

      Returns the time zone for which the cronExpression of this CronTrigger will be resolved.

    • setTimeZone

      public void setTimeZone(TimeZone timeZone)

      Sets the time zone for which the cronExpression of this CronTrigger will be resolved.

      If setCronExpression(CronExpression) is called after this method, the TimeZon setting on the CronExpression will "win". However if setCronExpression(String) is called after this method, the time zone applied by this method will remain in effect, since the String cron expression does not carry a time zone!

    • setCronExpression

      public void setCronExpression(String cronExpression)
    • setCronExpression

      public void setCronExpression(CronExpression cronExpression)
    • getCronEx

      public CronExpression getCronEx()
    • setCronEx

      public void setCronEx(CronExpression cronEx)
    • getRepeatLimit

      public int getRepeatLimit()
    • setRepeatLimit

      public void setRepeatLimit(int repeatLimit)
    • getRepeatCount

      public int getRepeatCount()
    • setRepeatCount

      public void setRepeatCount(int repeatCount)
    • getCalendarNames

      public String[] getCalendarNames()
    • setCalendarNames

      public void setCalendarNames(String[] calendarNames)
    • getCalendars

      public Calendars getCalendars()
    • setCalendars

      public void setCalendars(Calendars calendars)
    • determineCronExpression

      public static CronExpression determineCronExpression(String cronExpression)
    • hasNextFireTime

      public Date hasNextFireTime()
      Specified by:
      hasNextFireTime in interface Trigger
    • nextFireTime

      public Date nextFireTime()
      Specified by:
      nextFireTime in interface Trigger
    • setFirstFireTimeAfter

      public void setFirstFireTimeAfter()

      Returns the next time at which the CronTrigger will fire, after the given time. If the trigger will not fire after the given time, null will be returned.

      Note that the date returned is NOT validated against the related org.quartz.Calendar (if any)

    • getTimeAfter

      protected Date getTimeAfter(Date afterTime)
    • updateToNextIncludeDate

      public void updateToNextIncludeDate()