Rio Project 4.2 API Documentation



org.rioproject.config
Class AggregateConfig

java.lang.Object
  extended by org.rioproject.config.AggregateConfig
All Implemented Interfaces:
Configuration

public class AggregateConfig
extends Object
implements Configuration

The AggregateConfig provides an approach to aggregate configuration files, allowing entries to be resolved in a "common" Configuration.

Author:
Dennis Reedy

Field Summary
 
Fields inherited from interface net.jini.config.Configuration
NO_DATA, NO_DEFAULT
 
Constructor Summary
AggregateConfig(Configuration commonConfig, String[] configArgs)
          Create an AggregateConfig
AggregateConfig(Configuration commonConfig, String[] configArgs, ClassLoader loader)
          Create an AggregateConfig
 
Method Summary
 Configuration getCommonConfiguration()
          Get the common configuration this class was created with
 Object getEntry(String component, String name, Class type)
          Get an entry from the aggregate configuration files.
 Object getEntry(String component, String name, Class type, Object defaultValue)
          Get an entry from the aggregate configuration files.
 Object getEntry(String component, String name, Class type, Object defaultValue, Object data)
          Get an entry from the aggregate configuration files.
 Configuration getOuterConfiguration()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateConfig

public AggregateConfig(Configuration commonConfig,
                       String[] configArgs)
                throws ConfigurationException
Create an AggregateConfig

Parameters:
commonConfig - The "common" Configuration
configArgs - Configuration arguments for an 'outer' configuration. This configuration will be looked at first for configuration entries. If entries are not found, the common configuration is consulted.
Throws:
ConfigurationException - If there are errors creating the Configuration
IllegalArgumentException - if the commonConfig parameter is null

AggregateConfig

public AggregateConfig(Configuration commonConfig,
                       String[] configArgs,
                       ClassLoader loader)
                throws ConfigurationException
Create an AggregateConfig

Parameters:
commonConfig - - The "common" Configuration
configArgs - Configuration arguments for an 'outer' configuration. This configuration will be looked at first for configuration entries. If entries are not found, the common configuration is consulted.
loader - - The class loader to use for loading entries from the configuration file(s). If null, the classloader that loaded the AggregateConfig class is used
Throws:
ConfigurationException - If there are errors creating the Configuration
IllegalArgumentException - if the config parameter is null
Method Detail

getCommonConfiguration

public Configuration getCommonConfiguration()
Get the common configuration this class was created with

Returns:
The common Configuration object.

getEntry

public Object getEntry(String component,
                       String name,
                       Class type)
                throws ConfigurationException
Get an entry from the aggregate configuration files. If not found in the 'outer' config, look in the common configuration

Specified by:
getEntry in interface Configuration
Parameters:
component - the component being configured
name - the name of the entry for the component
type - the type of the object to be returned
Returns:
an object created using the information in the entry matching component and name, and using the value of data (unless it is NO_DATA), or defaultValue if no matching entry is found and defaultValue is not NO_DEFAULT
Throws:
ConfigurationException

getEntry

public Object getEntry(String component,
                       String name,
                       Class type,
                       Object defaultValue)
                throws ConfigurationException
Get an entry from the aggregate configuration files. If not found in the 'outer' config, look in the common configuration

Specified by:
getEntry in interface Configuration
Parameters:
component - the component being configured
name - the name of the entry for the component
type - the type of the object to be returned
defaultValue - the object to return if no matching entry is found, or NO_DEFAULT to specify no default
Returns:
an object created using the information in the entry matching component and name, and using the value of data (unless it is NO_DATA), or defaultValue if no matching entry is found and defaultValue is not NO_DEFAULT
Throws:
ConfigurationException

getEntry

public Object getEntry(String component,
                       String name,
                       Class type,
                       Object defaultValue,
                       Object data)
                throws ConfigurationException
Get an entry from the aggregate configuration files. If not found in the 'outer' config, look in the common configuration

Specified by:
getEntry in interface Configuration
Parameters:
component - the component being configured
name - the name of the entry for the component
type - the type of the object to be returned
defaultValue - the object to return if no matching entry is found, or NO_DEFAULT to specify no default
data - an object to use when computing the value of the entry, or NO_DATA to specify no data
Returns:
an object created using the information in the entry matching component and name, and using the value of data (unless it is NO_DATA), or defaultValue if no matching entry is found and defaultValue is not NO_DEFAULT
Throws:
ConfigurationException

getOuterConfiguration

public Configuration getOuterConfiguration()

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.