|
Oracle Fusion Middleware Java API Reference for Oracle ADF Share 11g Release 1 (11.1.1.9.0) E52934-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.adf.share.props.ConfigPropertyManager
oracle.adfinternal.share.props.CacheConfigPropertyManager
public class CacheConfigPropertyManager
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 |
---|
public CacheConfigPropertyManager()
Method Detail |
---|
public static CacheConfigPropertyManager createCacheConfigPropertyManager()
public static CacheConfigPropertyManager createCacheConfigPropertyManager(ScopeMaps scmps)
public static CacheConfigPropertyManager getCacheConfigPropertyManager()
public static CacheConfigPropertyManager getCacheConfigPropertyManager(ScopeMaps scMaps)
public java.lang.String getProperty(java.lang.String name)
oracle.adf.share.props.CacheConfigPropertyManager
getProperty
in class ConfigPropertyManager
name
- the name of the propertypublic java.lang.Integer getIntegerProperty(java.lang.String key)
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.name
- the name of the propertyADFShareException
- if the type conversion failspublic java.lang.Boolean getBooleanProperty(java.lang.String key)
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.name
- the name of the propertyADFShareException
- if the type conversion failsprotected void setPropertyLocal(java.lang.String key, java.lang.Object value, java.lang.String scope)
protected boolean setProperty(java.lang.String key, java.lang.Object value)
ConfigPropertyManager
setProperty
in class ConfigPropertyManager
key
- the property keyvalue
- value of the property to be set.protected boolean logCheckAndUpdate(ADFLogger log, java.lang.String key, int max)
protected void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
is null, no exception is thrown and no action is taken.addPropertyChangeListener
in class ConfigPropertyManager
listener
- The PropertyChangeListener to be addedprotected void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
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.removePropertyChangeListener
in class ConfigPropertyManager
listener
- The PropertyChangeListener to be removed
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Share 11g Release 1 (11.1.1.9.0) E52934-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |