Since Kernel 2.0.5, there is a registry for global configuration. It is actually a facade in front of system properties and has been added for several reasons:
- It manages a cache of the system properties, indeed system properties are expensive to retrieve as it involves security check and a synchronized map
- In future versions it could be extended to take configuration from some other place
- In future versions it will contains privileged code block in order to make exo products executable under a java security manager
The API is quite simple and similar to java.lang.System for property access, it is also possible to programmatically refresh the property cache, here is a excerpt of the API:
{code}
package org.exoplatform.commons.utils;
public class PropertyManager {
public static String getProperty(String propertyName) { ... }
public static void setProperty(String propertyName, String propertyValue) { ... }
public static boolean isDevelopping() { ... }
public synchronized static boolean getUseCache() { ... }
public synchronized static void refresh() { ... }
}
{code}
The property manager has a cache that is enabled by default. It is disabled only when the system property "exo.developing" is set to the value "false" at startup or read as "false" after a call to the refresh method of the manager.