Class DefaultTriggerService

  • All Implemented Interfaces:
    TriggerService

    public class DefaultTriggerService
    extends java.lang.Object
    implements TriggerService
    Default implementation of the trigger service.
    Since:
    4.3
    • Field Detail

      • IGNORE_VALUE

        public static final int IGNORE_VALUE
        ignored value for time, interval, max acceptable waits
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultTriggerService

        public DefaultTriggerService()
    • Method Detail

      • setCronJobService

        public void setCronJobService​(CronJobService cronJobService)
      • setModelService

        public void setModelService​(ModelService modelService)
      • setTriggerDao

        public void setTriggerDao​(TriggerDao triggerDao)
      • setI18NService

        public void setI18NService​(I18NService i18nService)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • activateForTest

        public boolean activateForTest​(TriggerModel trigger,
                                       long currentTime)
      • activate

        public void activate​(TriggerModel trigger)
        Description copied from interface: TriggerService
        Executes the assigned JobModel using the assigned CronJobModel if the next activation time ((@link TriggerModel#getActivationTime()} is less or equal than the current system time.
        Specified by:
        activate in interface TriggerService
        Parameters:
        trigger - the trigger instance
      • getConfigAttributes

        protected java.util.Map<java.lang.String,​java.lang.String> getConfigAttributes()
      • getNextTime

        public java.util.Calendar getNextTime​(TriggerModel trigger,
                                              java.util.Calendar relativeTo)
        Description copied from interface: TriggerService
        Returns the next activation time for the TriggerModel in relation to the specified calendar.

        Use this method e.g. for different first day of week modes.

        Specified by:
        getNextTime in interface TriggerService
        Parameters:
        trigger - the trigger instance
        relativeTo - the calendar which the next activation time should be calculated relatively for
        Returns:
        the next activation time(Calendar) for the TriggerModel in relation to the specified time
      • getPulseSeconds

        public int getPulseSeconds()
        Description copied from interface: TriggerService
        Returns a time interval at which trigger activation is fired. See cronjob.trigger.interval' property
        Specified by:
        getPulseSeconds in interface TriggerService
      • setPulseSeconds

        public void setPulseSeconds​(int interval)
        Description copied from interface: TriggerService
        Sets a time interval at which trigger activation is fired. See cronjob.trigger.interval' property .
        Specified by:
        setPulseSeconds in interface TriggerService