Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.1.0)

E17486-02

oracle.adf.share.prefs
Class ADFPreferencesFactory

java.lang.Object
  extended by oracle.adf.share.prefs.ADFPreferencesFactory
All Implemented Interfaces:
java.util.prefs.PreferencesFactory

public class ADFPreferencesFactory
extends java.lang.Object
implements java.util.prefs.PreferencesFactory

A factory object that generates Preferences objects. This factory class has been implemented to provide access to an MDS back ended Preferences Repository. This also brings with it a richer user concept based on the J2EE authenticated username, and the ability to define user over system customization levels beyond the standard Java Preferences API's system and user levels, which are also still catered for.
In order to support usage of the ADFPreferences Utility outside of the context of an ADF Web Application it is necessary to use the ADFPreferencesFactory(ADFPreferencesConfig config) constructor, where the ADFPreferencesConfig is based on the ADFPreferencesSimpleConfig object, that takes an MDSInstance object in it's constructor.
Consumers of the Preference Utility working within the context of an ADF web Application should use the constructor which takes no arguments as this will obtain the MDS Instance from the ADF Context object that has been configured against the web application.


Constructor Summary
ADFPreferencesFactory()
          The default constructor which assumes the MDSInstance object will be pulled from the ADF Web Application context object, as opposed to having the ADFPreferencesConfig passed into the constructor pre configured with the desired settings, i.e.
ADFPreferencesFactory(ADFPreferencesConfig config)
          Preference Factory constructor to be used by consumers who which to access the Preferences Utility outside the context of an ADF web application.
 
Method Summary
static void cleanUpApplicationState(java.lang.ClassLoader appClassLoader)
          This method cleans up ADFPreferences related objects from the application classloader.
protected  ADFPreferencesRegistry getRegistry()
          Returns the Application Preference Nodes registry from which preference root nodes are obtained.
 java.util.prefs.Preferences sharedSystemRoot()
          Returns the shared system root preference node corresponding to the calling J2EE authenicated user.
 java.util.prefs.Preferences sharedUserRoot()
          Returns the shared user root preference node corresponding to the calling J2EE authenicated user.
 java.util.prefs.Preferences systemRoot()
          Returns the system root preference node.
 java.util.prefs.Preferences userOverSystemRoot()
          Returns the user over system root preference node corresponding to the calling J2EE authenicated user where should no user preference exist the preference utility will then return the equivalent system preference, if the preference does not exist here
 java.util.prefs.Preferences userRoot()
          Returns the user root preference node corresponding to the calling J2EE authenicated user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADFPreferencesFactory

public ADFPreferencesFactory()
The default constructor which assumes the MDSInstance object will be pulled from the ADF Web Application context object, as opposed to having the ADFPreferencesConfig passed into the constructor pre configured with the desired settings, i.e. typically a user specified MDS instance instead of an ADFContext pulled instance.


ADFPreferencesFactory

public ADFPreferencesFactory(ADFPreferencesConfig config)
Preference Factory constructor to be used by consumers who which to access the Preferences Utility outside the context of an ADF web application. In order to do this the consumer is responsible for creating their own ADFPreferencesConfig object, typically through creating an ADFPreferencesSimpleConfig object that has been created through passing in an MDSInstance object pertinent to their environment.

Parameters:
config - The ADFPreferenceConfig object to be used by this factory.
Method Detail

systemRoot

public java.util.prefs.Preferences systemRoot()
Returns the system root preference node. (Multiple calls on this method will return the same object reference.)

Specified by:
systemRoot in interface java.util.prefs.PreferencesFactory
Returns:
The Preference node associated with the system root.

userRoot

public java.util.prefs.Preferences userRoot()
Returns the user root preference node corresponding to the calling J2EE authenicated user.

Specified by:
userRoot in interface java.util.prefs.PreferencesFactory
Returns:
The Preference node associated with the authenticated user root.

sharedUserRoot

public java.util.prefs.Preferences sharedUserRoot()
Returns the shared user root preference node corresponding to the calling J2EE authenicated user.

Returns:
The Preference node associated with the authenticated user root.

sharedSystemRoot

public java.util.prefs.Preferences sharedSystemRoot()
Returns the shared system root preference node corresponding to the calling J2EE authenicated user.

Returns:
The Preference node associated with the authenticated user root.

userOverSystemRoot

public java.util.prefs.Preferences userOverSystemRoot()
Returns the user over system root preference node corresponding to the calling J2EE authenicated user where should no user preference exist the preference utility will then return the equivalent system preference, if the preference does not exist here

Returns:
The Preference node associated with the authenticated user root.

getRegistry

protected ADFPreferencesRegistry getRegistry()
Returns the Application Preference Nodes registry from which preference root nodes are obtained.

Returns:
The preference nodes registry unique for the current class loader.

cleanUpApplicationState

public static void cleanUpApplicationState(java.lang.ClassLoader appClassLoader)
This method cleans up ADFPreferences related objects from the application classloader. This method is called by lifecycle listeners in order to clean up application class loader state during the operations of application shutdown or deploy. It removes objects associated with the Preference API from a registry which no longer needs to maintain the objects after application shutdown or delete.

Parameters:
appClassLoader - The application class loader.

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.1.0)

E17486-02

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