Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.9.0)

E52934-01


oracle.adfinternal.share.props
Class CacheConfigPropertyManager

java.lang.Object
  extended by oracle.adf.share.props.ConfigPropertyManager
      extended by oracle.adfinternal.share.props.CacheConfigPropertyManager


public class CacheConfigPropertyManager
extends ConfigPropertyManager

This class is for internal use only. It provides functionality related to ADF configuration properties framework. The configuration properites are used for enabling and disabling features in ADF framework. The default values of configuration properties are specific in adf-settings.xml files as follows: <adp:adf-properties-settings xmlns="http://xmlns.oracle.com/adf/properties/settings"> <value-provider class="oracle.adfinternal.share.props.TestPropertyProviderImpl"/> <default-values> <property-default name="oracle_adfinternal_share_props_MyTestPropName1" value="oracle.adfinternal.share.props.MyTestPropValue1"/> <property-default name="oracle_adfinternal_share_props_MyTestPropName2" value="oracle.adfinternal.share.props.MyTestPropValue2"/> <property-default name="oracle_java_lang_Integer_PropName_1" value="1"/> <property-default name="oracle_java_lang_Boolean_PropName_true" value="true"/> <property-default name="oracle_java_lang_Boolean_PropName_false" value="nottrue"/> </default-values> </adp:adf-properties-settings> The <value-provider class="oracle.adfinternal.share.props.TestPropertyProviderImpl"/> section is required only if new provider class must be supplied The value-provider class must inherit from oracle.adf.share.props.ConfigProvider. The property names and default values can be supplied under the <default-values> section. This class provides API's for returning property value for a given key. To use this class (adf-settings.xml contents as sepcified above) CacheConfigPropertyManager configMgr = CacheConfigPropertyManager.getCacheConfigPropertyManager(); String propertyname="oracle_adf_share_props_MyTestPropName1"; String propertyValue = configMgr.getProperty(propertyName); // propertyValue = oracle.adfinternal.share.props.MyTestPropValue1 String booleanPropName= oracle.java.lang.Boolean.PropName.true";" + Boolean booleanPropVal= configMgr.getBooleanProperty(booleanPropName); // booleanPropVal = Boolean "true" Here is how property value for a given key is obtained (1) For any key, that is not registered in adf-settings.xml or if the key does not start with "oracle." or if it is more than 76 characters, null value is returned. (2) The call is delegated to the registered value-provider class. If value-provider returns a non null value, it is returned as the property value. (3) If (2) returns null, then the framework returns the value as specified in the adf-settings.xml file. Note that the property values for all keys as returned by the registered value-provider class are cached during application initialization into ADF Application scope. So only the cached values are returned by the framework even if the the registered value-provider returns a different value. Following are additional considertations: (1) These properties are immutable except for writing tests. See oracle.adf.share.props.CacheConfigPropertyManagerTester for API's for changing property values (2) The multi-threaded behavior of this class is tied to the oracle.adf.share.ADFContext application scope as the scope of the instance of this class and corresponding properties is same as oracle.adf.share.ADFContext#getApplicationScope (3) Using this class requires intitalization of oracle.adf.share.ADFContext. This happens after ADFBindingFilter has already executed in an ADF web request. For non web requests, ADFContext must be explicityly initialized. (4) The properties are not currently partitioned by tenant (5) The framework does support notifications for property changes for testing only


Constructor Summary
CacheConfigPropertyManager()
           

 

Method Summary
protected  void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
static CacheConfigPropertyManager createCacheConfigPropertyManager()
          Creates a new instance of this class
static CacheConfigPropertyManager createCacheConfigPropertyManager(ScopeMaps scmps)
          Creates a new instance of this class
 java.lang.Boolean getBooleanProperty(java.lang.String key)
          returns the property value for the specified key.
static CacheConfigPropertyManager getCacheConfigPropertyManager()
          Create CacheConfigPropertyManager instance and stores it in adf context application scope.
static CacheConfigPropertyManager getCacheConfigPropertyManager(ScopeMaps scMaps)
          Create CacheConfigPropertyManager instance and stores it in adf context application scope.
 java.lang.Integer getIntegerProperty(java.lang.String key)
          returns the property value for the specified key.
 java.lang.String getProperty(java.lang.String name)
          returns the property value for the specified key.
protected  boolean logCheckAndUpdate(ADFLogger log, java.lang.String key, int max)
           
protected  void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
protected  boolean setProperty(java.lang.String key, java.lang.Object value)
          sets the specified property value.
protected  void setPropertyLocal(java.lang.String key, java.lang.Object value, java.lang.String scope)
           

 

Methods inherited from class oracle.adf.share.props.ConfigPropertyManager
getConfigPropertyManager, getDefaultConfigPropertyProviderImpl, getPropDump, getPropertyInternal, getPropKeys, getPropMetadata, validateKey

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

CacheConfigPropertyManager

public CacheConfigPropertyManager()

Method Detail

createCacheConfigPropertyManager

public static CacheConfigPropertyManager createCacheConfigPropertyManager()
Creates a new instance of this class
Returns:

createCacheConfigPropertyManager

public static CacheConfigPropertyManager createCacheConfigPropertyManager(ScopeMaps scmps)
Creates a new instance of this class
Returns:

getCacheConfigPropertyManager

public static CacheConfigPropertyManager getCacheConfigPropertyManager()
Create CacheConfigPropertyManager instance and stores it in adf context application scope. Subsequent calls return the stored instance
Returns:
instance of this class

getCacheConfigPropertyManager

public static CacheConfigPropertyManager getCacheConfigPropertyManager(ScopeMaps scMaps)
Create CacheConfigPropertyManager instance and stores it in adf context application scope. Subsequent calls return the stored instance
Returns:
instance of this class

getProperty

public java.lang.String getProperty(java.lang.String name)
returns the property value for the specified key. For value look-up details, please see oracle.adf.share.props.CacheConfigPropertyManager
Overrides:
getProperty in class ConfigPropertyManager
Parameters:
name - the name of the property
Returns:
string value of the property

getIntegerProperty

public java.lang.Integer getIntegerProperty(java.lang.String key)
returns the property value for the specified key. For value look-up details, please see oracle.adf.share.props.CacheConfigPropertyManager the string value of the property is converted to Integer. For conversion Integer.valueOf(java.lang.String, int) operation is used. The converted value is cached so only the first call to this API takes the type conversion hit An ADFShareException is thrown if the conversion fails.
Parameters:
name - the name of the property
Returns:
Integer value of the property
Throws:
ADFShareException - if the type conversion fails

getBooleanProperty

public java.lang.Boolean getBooleanProperty(java.lang.String key)
returns the property value for the specified key. For value look-up details, please see oracle.adf.share.props.CacheConfigPropertyManager the string value of the property is converted to Boolean. For conversion Boolean.valueOf(boolean) operation is used. The converted value is cached so only the first call to this API takes the type conversion hit An ADFShareException is thrown if the conversion fails.
Parameters:
name - the name of the property
Returns:
Boolean value of the property
Throws:
ADFShareException - if the type conversion fails

setPropertyLocal

protected void setPropertyLocal(java.lang.String key,
                                java.lang.Object value,
                                java.lang.String scope)

setProperty

protected boolean setProperty(java.lang.String key,
                              java.lang.Object value)
Description copied from class: ConfigPropertyManager
sets the specified property value. This API will delegate to the registered provider which may choose to ignore it The API is mainly used for writing tests
Overrides:
setProperty in class ConfigPropertyManager
Parameters:
key - the property key
value - value of the property to be set.
Returns:
true if the operation was successfully performed, false otherwise

logCheckAndUpdate

protected boolean logCheckAndUpdate(ADFLogger log,
                                    java.lang.String key,
                                    int max)

addPropertyChangeListener

protected void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. If listener is null, no exception is thrown and no action is taken.
Overrides:
addPropertyChangeListener in class ConfigPropertyManager
Parameters:
listener - The PropertyChangeListener to be added

removePropertyChangeListener

protected void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener was added more than once to the same event source, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.
Overrides:
removePropertyChangeListener in class ConfigPropertyManager
Parameters:
listener - The PropertyChangeListener to be removed

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.9.0)

E52934-01


Copyright © 1997, 2015, Oracle. All rights reserved.