Skip navigation links

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

E67677-01


oracle.adf.share.props
Class ConfigPropertyManager

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

Direct Known Subclasses:
CacheConfigPropertyManager

public class ConfigPropertyManager
extends java.lang.Object

This class 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 specified in adf-settings.xml files as follows: The property names and default values can be supplied under the <default-values> element. <adf-settings xmlns="http://xmlns.oracle.com/adf/settings"> <adp:adf-properties-settings xmlns="http://xmlns.oracle.com/adf/properties/settings"> <value-provider> <class>oracle.adfinternal.share.props.TestPropertyProviderImpl</class> </value-provider> <properties> <property> <name>oracle.adfinternal.share.props.MyTestPropName1</name> <default-value>oracle.adfinternal.share.props.MyTestPropValue1</default-value> </property> <property> <name>oracle.adfinternal.share.props.MyTestPropName2</name> <default-value>oracle.adfinternal.share.props.MyTestPropValue2</default-value> </property> </properties> </adp:adf-properties-settings> The <value-provider> <class>oracle.adfinternal.share.props.TestPropertyProviderImpl</class> </value-provider> section is required only if new provider class must be supplied. Provider provides the value of a given property name and is used by this class during property look-up as described below. There can be only one property provider per ADFContext application scope which in turn maps to a J2EE .war. The value-provider class must inherit from oracle.adf.share.props.ConfigProvider. This class provides API's for returning property value for a given key. To use this class (adf-settings.xml contents as sepcified above Here is an example usage of ConfigPropertyManager: ConfigPropertyManager configMgr = ConfigPropertyManager.getConfigPropertyManager(); String propertyname="oracle_adf_share_props_MyTestPropName1"; String propertyValue = configMgr.getProperty(propertyName); // propertyValue = oracle.adfinternal.share.props.MyTestPropValue1 Here is how property value for a given key is obtained

  1. For any key, that 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.

Following are additional considertations:

  1. The framework does not support setting a property value except for writing tests. See oracle.adf.share.props.ConfigPropertyManagerTester for API's for changing property values
  2. The read-consistency is dependent on the underlying provider. The framework always delegates to the underlying provider and returns back the current value returned by the provider
  3. 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
  4. This class maybe used only when oracle.adf.share.ADFContext has already been intialized
  5. The framework does not provider any support for partitioning the properties by tenant. For the framwork to work in multi-tenant mode, oracle.adf.share.ADFContext#getApplicationScope and registered provider must supportmulti-tenant mode
  6. The framework does support notifications for property changes for testing only

Field Summary
protected static java.lang.String DEF_CONF_PROP_MGR
           

 

Constructor Summary
ConfigPropertyManager()
          DO NOT call this constructor directly.

 

Method Summary
protected  void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
static ConfigPropertyManager getConfigPropertyManager()
           
protected  DefaultConfigPropertyProviderImpl getDefaultConfigPropertyProviderImpl()
           
 java.lang.String getPropDump()
           
 java.lang.String getProperty(java.lang.String name)
          returns the property value for the specified key.
protected  java.lang.String getPropertyInternal(java.lang.String name)
           
protected  java.util.List<java.lang.String> getPropKeys()
           
protected  ConfigPropertyMetadata getPropMetadata(java.lang.String name)
           
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  boolean validateKey(java.lang.String name)
           

 

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

 

Field Detail

DEF_CONF_PROP_MGR

protected static final java.lang.String DEF_CONF_PROP_MGR
See Also:
Constant Field Values

Constructor Detail

ConfigPropertyManager

public ConfigPropertyManager()
DO NOT call this constructor directly. Use getConfigPropertyManager() instead.

Method Detail

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 ConfigPropertyManager If the property name is not found, null value is returned. If the property name does not start with "oracle." or is greater than 76 characters, null value is returned.
Parameters:
name - the name of the property
Returns:
string value of the property

getPropDump

public java.lang.String getPropDump()
Returns:
the String representation of properties dump. This includes property name, value, type, source of the property and location of adf-settings.xml file from where the default value is read

getPropKeys

protected java.util.List<java.lang.String> getPropKeys()

getPropMetadata

protected ConfigPropertyMetadata getPropMetadata(java.lang.String name)

getConfigPropertyManager

public static ConfigPropertyManager getConfigPropertyManager()

getDefaultConfigPropertyProviderImpl

protected DefaultConfigPropertyProviderImpl getDefaultConfigPropertyProviderImpl()

validateKey

protected boolean validateKey(java.lang.String name)

getPropertyInternal

protected java.lang.String getPropertyInternal(java.lang.String name)

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.
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.
Parameters:
listener - The PropertyChangeListener to be removed

setProperty

protected boolean setProperty(java.lang.String key,
                              java.lang.Object value)
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
Parameters:
key - the property key
value - value of the property to be set.
Returns:
true if the operation was successfully performed, false otherwise

Skip navigation links

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

E67677-01


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