public class AdminConfigCacheUpdater
extends java.lang.Thread
Modifier and Type | Field and Description |
---|---|
private AdminConfigurationMgrIf |
adminConfMgr
AdminConfigurationMgr
|
private java.util.HashMap<java.lang.String,AdminConfigurationMgrIf> |
adminConfMgrMap
Keep the AdminConfigMgr instances in a map
|
private static long |
DEFAULT_SLEEP_MILLIS
Default sleep time in millis (30 secs)
|
private KKAdminIf |
eng
Engine Instance that started the thread
|
private java.util.HashMap<java.lang.String,java.util.Date> |
lastModifiedMap
Last time the config variable was modified.
|
private org.apache.commons.logging.Log |
log
The
Log instance for this class. |
private boolean |
loop
Variable to decide whether to keep looping
|
private long |
sleepMillis |
Constructor and Description |
---|
AdminConfigCacheUpdater(KKAdminIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private AdminConfigurationMgrIf |
addConfigMgrToMap(java.lang.String storeId)
Add an engine to the engine map
|
private KKConfiguration[] |
getConfigsInMultiStoreSharedDBMode()
An array of KKConfiguration objects is returned; one for each store.
|
void |
run()
This thread runs forever.
|
private void |
setCheckInterval()
Set the interval for checking the configuration flag.
|
void |
stopLooping()
Stop the current thread from looping
|
private void |
updateConfigs()
Reads a config variable for all stores and decides whether or not to do the update based on
whether the config variable was modified since last time it was read.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private org.apache.commons.logging.Log log
Log
instance for this class.private static final long DEFAULT_SLEEP_MILLIS
private long sleepMillis
private java.util.HashMap<java.lang.String,java.util.Date> lastModifiedMap
private java.util.HashMap<java.lang.String,AdminConfigurationMgrIf> adminConfMgrMap
private boolean loop
private KKAdminIf eng
private AdminConfigurationMgrIf adminConfMgr
public AdminConfigCacheUpdater(KKAdminIf eng) throws java.lang.Exception
eng
- The engine that started the threadjava.lang.Exception
- an unexpected exceptionprivate void setCheckInterval() throws com.konakart.app.KKException, KKAdminException
com.konakart.app.KKException
- an unexpected KKException exceptionKKAdminException
- an unexpected KKAdminException exceptionpublic void stopLooping()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private void updateConfigs() throws java.lang.Exception
java.lang.Exception
- an unexpected exceptionprivate AdminConfigurationMgrIf addConfigMgrToMap(java.lang.String storeId) throws java.lang.Exception
storeId
- the storeIdjava.lang.Exception
- an unexpected exceptionprivate KKConfiguration[] getConfigsInMultiStoreSharedDBMode() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, com.konakart.app.KKException
org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionCopyright © 2018 DS Data Systems UK Ltd.