Package org.exoplatform.commons.utils
Class PropertyManager
java.lang.Object
org.exoplatform.commons.utils.PropertyManager
A property manager that acts as a facade of the system properties. The manager has a cache that is only disabled
if the property exo.product.developing is set to the false string. The cache usage is read once during the static
initialization of the cache and it can be programmatically triggered by calling the
refresh() method.
TODO add security privileged blocks used when eXo is executed under a security manager- Version:
- $Revision$
- Author:
- Julien Viet
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiesReturns all system properties.static PropertiesgetPropertiesByPattern(String propertyPattern) Returns the system properties from the provided property name pattern.static StringgetProperty(String propertyName) Returns a property from the provided property name.static booleanReturns true if the cache is enabled.static booleanReturns true if the product developing mode is enabled.static voidrefresh()Refresh the property manager.static voidsetProperty(String propertyName, String propertyValue) Update a property in the system properties and in the cache.
-
Field Details
-
DEVELOPING
.- See Also:
-
RUNTIME_PROFILES
.- See Also:
-
PROPERTIES_URL
.- See Also:
-
-
Constructor Details
-
PropertyManager
public PropertyManager()
-
-
Method Details
-
getProperty
Returns a property from the provided property name. If the property value is not found it returns null.- Parameters:
propertyName- the property name- Returns:
- the property value
-
getPropertiesByPattern
Returns the system properties from the provided property name pattern.- Parameters:
propertyPattern- the property name pattern- Returns:
- the list of property keys
-
getProperties
Returns all system properties.- Returns:
- the list of property keys
-
isDevelopping
public static boolean isDevelopping()Returns true if the product developing mode is enabled.- Returns:
- the product developing mode
-
setProperty
Update a property in the system properties and in the cache.- Parameters:
propertyName- the property namepropertyValue- the property value
-
getUseCache
public static boolean getUseCache()Returns true if the cache is enabled.- Returns:
- the use cache value
-
refresh
public static void refresh()Refresh the property manager. The cache is cleared and the cache usage is read from the system properties.
-