Class AbstractPollingTask

    • Constructor Detail

      • AbstractPollingTask

        public AbstractPollingTask()
    • Method Detail

      • getFirstExecution

        public Date getFirstExecution()
        Description copied from interface: PollingTask
        Returns the first execution time for this polling task
        Specified by:
        getFirstExecution in interface PollingTask
      • initialize

        public void initialize()
        Description copied from interface: PollingTask
        Perform the initialization lazily. Invoked before the polling task is executed for the first time
        Specified by:
        initialize in interface PollingTask
      • isExclusiveInCluster

        public boolean isExclusiveInCluster()
        By default, PollingTasks are exclusive in clusters
        Specified by:
        isExclusiveInCluster in interface PollingTask
      • run

        public final void run()
        Specified by:
        run in interface Runnable
      • dateFromDelay

        protected Date dateFromDelay​(int seconds)
      • doRun

        protected abstract void doRun()
        Subclasses must implement this method to do the task.
      • getInitialSleepSeconds

        protected Integer getInitialSleepSeconds()
        The number of seconds before the first execution. By default is a random time between 0 and getSleepSeconds(). If returns null, the polling task is disabled.
      • getSecondsUntilNextDay

        protected int getSecondsUntilNextDay()
        Returns the number of seconds until the next day
      • getSecondsUntilNextHour

        protected int getSecondsUntilNextHour()
        Returns the number of seconds until the next hour
      • getSleepSeconds

        protected int getSleepSeconds()
      • getStorage

        protected EntityBackedParameterStorage getStorage()
        Returns a storage that subclasses may use to store data between executions