org.exoplatform.commons.utils
Class PropertyManager

java.lang.Object
  extended by org.exoplatform.commons.utils.PropertyManager

public class PropertyManager
extends java.lang.Object

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.

Version:
$Revision$
Author:
Julien Viet

Field Summary
static java.lang.String DEVELOPING
          .
 
Constructor Summary
PropertyManager()
           
 
Method Summary
static java.lang.String getProperty(java.lang.String propertyName)
          Returns a property from the provided property name.
static boolean getUseCache()
          Returns true if the cache is enabled.
static boolean isDevelopping()
          Returns true if the product developing mode is enabled.
static void refresh()
          Refresh the property manager.
static void setProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Update a property in the system properties and in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEVELOPING

public static final java.lang.String DEVELOPING
.

See Also:
Constant Field Values
Constructor Detail

PropertyManager

public PropertyManager()
Method Detail

getProperty

public static java.lang.String getProperty(java.lang.String propertyName)
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

isDevelopping

public static boolean isDevelopping()
Returns true if the product developing mode is enabled.

Returns:
the product developing mode

setProperty

public static void setProperty(java.lang.String propertyName,
                               java.lang.String propertyValue)
Update a property in the system properties and in the cache.

Parameters:
propertyName - the property name
propertyValue - 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.



Copyright © 2010 eXo Platform SAS. All Rights Reserved.