Package org.alfresco.util
Class ConfigScheduler<Data>
java.lang.Object
org.alfresco.util.ConfigScheduler<Data>
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
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Data
getData()
abstract boolean
boolean
readConfigAndReplace
(boolean scheduledRead) Should only be called directly from test code.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.void
setShutdownIndicator
(ShutdownIndicator shutdownIndicator)
-
Field Details
-
CONFIG_SCHEDULER
- See Also:
-
data
-
-
Constructor Details
-
ConfigScheduler
-
-
Method Details
-
setShutdownIndicator
-
readConfig
- Throws:
IOException
-
createData
-
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.
-