|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
uk.org.iscream.cms.server.componentmanager.ConfigurationProxy
public class ConfigurationProxy
A Configuration Proxy hold configurations caches and maintains configurations obtained from the Configuration Manager. It also has support for checking for updates in configurations, if a change is detected, it reloads all the changed configurations. This is done by a thread which runs every ConfigurationProxy.updateTime seconds. This is a singleton class, and should be used by all classes that wish to gain a configuration from the server, as it then allows them to be dynamically reconfigured.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private HashMap |
_configCache
Holds a list of configuration cache's for every configuration that has been requested of this proxy. |
private ConfigurationManager |
_confman
This holds a reference to the configuration manager |
private static ConfigurationProxy |
_instance
A reference to the single instance of this class |
private Logger |
_logger
This holds a reference to the system logger that is being used. |
private String |
_name
This is the friendly identifier of the component this class is running in. |
private ReferenceManager |
_refman
A reference to the reference manager in use |
private boolean |
_running
Holds the current state of the configuration proxy's thread |
int |
DEFAULT_REFRESH_TIME
The default time to refresh the configurations - 60 seconds. |
static String |
REVISION
The current CVS revision of this class |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
private |
ConfigurationProxy()
Construct a ConfigurationProxy Then starts the auto-updating part (the thread) running. |
Method Summary | |
---|---|
String |
getFileList(String configName)
This method obtains the configuration from the configuration cache, if the configuration isn't in the cache, it adds it. |
static ConfigurationProxy |
getInstance()
Return a reference to the single class. |
long |
getLastModified(String configName)
This method obtains the configuration from the configuration cache, if the configuration isn't in the cache, it adds it. |
String |
getProperty(String configName,
String propertyName)
This method obtains the configuration from the configuration cache, if the configuration isn't in the cache, it adds it. |
void |
run()
This method runs and waits for a period defined by ConfigurationProxy.updateTime. |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, 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, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public final int DEFAULT_REFRESH_TIME
private String _name
private Logger _logger
private ReferenceManager _refman
private ConfigurationManager _confman
private HashMap _configCache
private boolean _running
private static ConfigurationProxy _instance
Constructor Detail |
---|
private ConfigurationProxy()
Method Detail |
---|
public static ConfigurationProxy getInstance()
public void run()
run
in interface Runnable
run
in class Thread
public String getProperty(String configName, String propertyName) throws PropertyNotFoundException
configName
- the name of the configurationpropertyName
- the name of the property to obtain
PropertyNotFoundException
public String getFileList(String configName)
configName
- the name of the configuration
public long getLastModified(String configName)
configName
- the name of the configuration
public String toString()
Object.toString()
method to provide clean logging (every class should have this).
This uses the uk.org.iscream.cms.util.FormatName class
to format the toString()
toString
in class Thread
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |