Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.share.config
Class Customization

java.lang.Object
  |
  +--oracle.cabo.share.config.Configuration
        |
        +--oracle.cabo.share.config.Customization

public class Customization
extends Configuration

The Customization class is a Configuration implementation which allows Configuration properties to be customized on a per-request basis. Most applications use a small number of ConfigurationImpl instances, which store global configuration settings for all users. However, certain Configuration properties, such as the LOOK_AND_FEEL or USER_STYLE_SHEET typically need to be specified on a per-user basis, based on the end user's preferences. Rather than create and intitialize a new ConfigurationImpl instance for each request, applications can create a lighter weight Customization instance which wraps the Configuration instance. Specific Configuration properties can then be overridden for the request via the Customization.putProperty() method.

Like all Configuration instances, Customization objects can be registered via the Configuration.register() API. Customization objects are somewhat different from other Configuration instances, as Customization instances should only exist while the user session for which the Customization is being used is valid. Once the user logs out, or the user's session expires, the application must unregister the user's Customization object by calling Configuration.unregister(). Failing to unregister a Customization object which is no longer being used results in a memory leak.

Note: Due to the extra burden that the unregistration requirement places on the application, the behavior of the Customization API is slightly more lenient than other Configuration implementations, such as the ConfigurationImpl class, which requires that all ConfigurationImpl instances be registered. Applications can elect not to register Customization instances. In this case, the user's preferred customizations may not be honored in certain situations. For example, UIX Components may render auxilary windows, such as the calendar dialog for date picking, without the user's customized preferences.


Fields inherited from class oracle.cabo.share.config.Configuration
ACCESSIBILITY_MODE, BASE_DIRECTORY, DISABLE_CONTENT_COMPRESSION, HEADLESS, HELP_PROVIDER, IMAGE_SERVLET_URL, IMAGE_TYPE_MANAGER, IMAGES_CACHE_DIRECTORY, IMAGES_DIRECTORY, JSLIBS_DIRECTORY, JSPS_DIRECTORY, LOOK_AND_FEEL, LOOK_AND_FEEL_MANAGER, RENDERER_MANAGER, STYLE_SHEET_NAME, STYLES_CACHE_DIRECTORY, STYLES_DIRECTORY, TECATE_SERVLET_URL, TRANSLATION_LOCALE_MAPPER, USER_STYLE_SHEET, XML_PROVIDER
 
Constructor Summary
Customization(Configuration config)
          Creates a Customization which wraps the specified Configuration instance.
Customization(java.lang.String name, Configuration config)
          Creates a named Customization which wraps the specific Configuration instance.
 
Method Summary
 java.lang.String getPath(java.lang.Object key, java.lang.String contextPath)
          Return a path for a Cabo directory.
 java.lang.Object getProperty(java.lang.Object key)
          Return a registered property.
 java.lang.String getURI(java.lang.Object key, java.lang.String contextURI)
          Return a URI for a Cabo directory.
 boolean isDebug()
          Returns whether the configuration is in debug mode.
 void putProperty(java.lang.Object key, java.lang.Object value)
          Registers a property.
 
Methods inherited from class oracle.cabo.share.config.Configuration
getConfiguration, getConfiguration, getName, register, register, unregister, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Customization

public Customization(Configuration config)
Creates a Customization which wraps the specified Configuration instance.

Customization

public Customization(java.lang.String name,
                     Configuration config)
Creates a named Customization which wraps the specific Configuration instance. If a name is specified, the application must register the Customization instance by calling register(). Also, the application must unregister the Customization instance by calling unregister() when the Customization is no longer in use. Failing to unregister a Customization instance which is no longer in use results in a memory leak.
Method Detail

getURI

public java.lang.String getURI(java.lang.Object key,
                               java.lang.String contextURI)
Return a URI for a Cabo directory. The Customization object obtains the URI from the wrapped Configuration object.
Overrides:
getURI in class Configuration
Following copied from class: oracle.cabo.share.config.Configuration
Parameters:
key - the key used to identify the directory
contextURI - the current contextURI; this will be preprended to the returned URI if this directory is registered as (or defaulting to) context-relative. This path must not be terminated with a separator ("/").
Returns:
a URI, which will always be terminated with a separator
Throws:
DirectoryUnavailableException - if the directory is unavailable

getPath

public java.lang.String getPath(java.lang.Object key,
                                java.lang.String contextPath)
Return a path for a Cabo directory. The Customization object obtains the path from the wrapped Configuration object.
Overrides:
getPath in class Configuration
Following copied from class: oracle.cabo.share.config.Configuration
Parameters:
key - the key used to identify the directory
contextPath - the current context path; this will be preprended to the returned path if this directory is registered as (or defaulting to) context-relative.
Returns:
a full file system path, which will always be terminated with the appropriate separator for the file system
Throws:
DirectoryUnavailableException - if the directory is unavailable

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Return a registered property. If the specified property has been explicitly registered on the Customization object using Customization.putProperty(), the specified property is returned. Otherwise, the property is retrieved from the wrapped Configuration object.
Overrides:
getProperty in class Configuration
Parameters:
key - the key used to identify the property
Returns:
the registered object, or the object registered on the wrapped Configuration.

putProperty

public void putProperty(java.lang.Object key,
                        java.lang.Object value)
Registers a property. The property value specified on the Customization object overrides the corresponding property on the wrapped Configuration object.

isDebug

public boolean isDebug()
Returns whether the configuration is in debug mode.
Overrides:
isDebug in class Configuration

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.