Package hudson.model

Class AperiodicWork

    • Field Detail

      • logger

        protected final Logger logger
    • Constructor Detail

      • AperiodicWork

        public AperiodicWork()
    • Method Detail

      • getRecurrencePeriod

        public abstract long getRecurrencePeriod()
        Gets the number of milliseconds between successive executions.

        Jenkins calls this method every time the timer task is scheduled.

      • getNewInstance

        public abstract AperiodicWork getNewInstance()
        Gets new instance of task to be executed. Method should return new instance each time, as there no check, if previously scheduled task already finished. Returning same instance could lead to throwing IllegalStateException (especially in case of AsyncAperiodicWork) and therefore scheduling of next tasks will be broken.
        Returns:
        AperiodicWork - timer task instance to be executed
      • getInitialDelay

        public long getInitialDelay()
        Gets the number of milliseconds till the first execution.

        By default it chooses the value randomly between 0 and getRecurrencePeriod()

      • doAperiodicRun

        protected abstract void doAperiodicRun()