Class Cron

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<AbstractRatInput>, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, RatInput, Serializable

    public class Cron
    extends AbstractMetaRatInput
    Uses a cronjob for defining the execution of the base rat input.
    For more information on the scheduler format see:
    http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -input <adams.flow.standalone.rats.input.RatInput> (property: input)
        The receiver to wrap.
        default: adams.flow.standalone.rats.input.DummyInput
     
    -schedule <adams.core.base.CronSchedule> (property: schedule)
        The schedule for executing the base rat input; format 'SECOND MINUTE HOUR 
        DAYOFMONTH MONTH WEEKDAY [YEAR]'.
        default: 0 0 1 * * ?
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Schedule

        protected adams.core.base.CronSchedule m_Schedule
        the cron schedule.
      • m_Scheduler

        protected org.quartz.Scheduler m_Scheduler
        the scheduler.
    • Constructor Detail

      • Cron

        public Cron()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractMetaRatInput
      • setSchedule

        public void setSchedule​(adams.core.base.CronSchedule value)
        Sets the execution schedule.
        Parameters:
        value - the schedule
      • getSchedule

        public adams.core.base.CronSchedule getSchedule()
        Returns the execution schedule.
        Returns:
        the schedule
      • scheduleTipText

        public String scheduleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class AbstractMetaRatInput
        Returns:
        null if no info available, otherwise short string
      • receiveData

        protected String receiveData()
        Retrieves data using the base input.
        Returns:
        null if successful, otherwise error message
      • callReceive

        protected String callReceive()
        Hook method that calls the base-input's receive() method using a cronjob.
        Overrides:
        callReceive in class AbstractMetaRatInput
        Returns:
        null if successful, otherwise error message
      • stopScheduler

        protected void stopScheduler()
        Stops the internal cron scheduler, if possible.