Class ConfigScheduler<Data>

java.lang.Object
org.alfresco.util.ConfigScheduler<Data>

public abstract class ConfigScheduler<Data> extends Object
Used to schedule reading of config. The config is assumed to change from time to time. Initially or on error the reading frequency is high but slower once no problems are reported. If the normal cron schedule is not set or is in the past, the config is read only once when run(boolean, Log, CronExpression, CronExpression) is called.
Author:
adavis
  • Field Details

  • Constructor Details

    • ConfigScheduler

      public ConfigScheduler(Object client)
  • Method Details

    • setShutdownIndicator

      public void setShutdownIndicator(ShutdownIndicator shutdownIndicator)
    • readConfig

      public abstract boolean readConfig() throws IOException
      Throws:
      IOException
    • createData

      public abstract Data createData()
    • getData

      public Data getData()
    • run

      public void run(boolean enabled, org.apache.commons.logging.Log log, org.quartz.CronExpression cronExpression, org.quartz.CronExpression initialAndOnErrorCronExpression)
      This method should only be called once in production on startup generally from Spring afterPropertiesSet methods. In testing it is allowed to call this method multiple times, but in that case it is recommended to pass in a null cronExpression (or a cronExpression such as a date in the past) so the scheduler is not started. If this is done, the config is still read, but before the method returns.
    • readConfigAndReplace

      public boolean readConfigAndReplace(boolean scheduledRead)
      Should only be called directly from test code.