Class AggregateConfig
- All Implemented Interfaces:
Configuration
-
Field Summary
Fields inherited from interface net.jini.config.Configuration
NO_DATA, NO_DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionAggregateConfig(String[] configs) Create an AggregateConfigAggregateConfig(String[] configs, ClassLoader loader) Create an AggregateConfigAggregateConfig(Configuration config, String[] configArgs) Create an AggregateConfigAggregateConfig(Configuration config, String[] configArgs, ClassLoader loader) Create an AggregateConfig -
Method Summary
Modifier and TypeMethodDescriptionGet the common configuration this class was created withReturns an object of the specified type created using the information in the entry matching the specified component and name, which must be found, and supplying no data.Returns an object of the specified type created using the information in the entry matching the specified component and name, and supplying no data, returning the default value if no matching entry is found and the default value is notConfiguration.NO_DEFAULT.Returns an object of the specified type created using the information in the entry matching the specified component and name, and using the specified data (unless it isConfiguration.NO_DATA), returning the default value if no matching entry is found and the default value is notConfiguration.NO_DEFAULT.
-
Constructor Details
-
AggregateConfig
Create an AggregateConfig- Parameters:
config- The "common" ConfigurationconfigArgs- Configuration arguments which may declare entries of the form $component_entry. These entries will be resolved in the "common" Configuration. Parsing of the end config would be done by ConfigurationFile which delegates special entry resolution to this class.- Throws:
ConfigurationException
-
AggregateConfig
public AggregateConfig(Configuration config, String[] configArgs, ClassLoader loader) throws ConfigurationException Create an AggregateConfig- Parameters:
config- - The "common" ConfigurationconfigArgs- - Configuration arguments which may declare entries of the form $component_entry. These entries will be resolved in the "common" Configuration. Parsing of the end config would be done by ConfigurationFile which delegates special entry resolution to this class.loader- - The class loader to use for interpreting class names- Throws:
ConfigurationException
-
AggregateConfig
Create an AggregateConfig- Parameters:
configs- An array of configArgs, where the common config is specified as the last element of the array. The first element of the array defines the config which may may declare entries of the form $component_entry. These entries will be resolved in the "common" Configuration. Parsing of the end config would be done by ConfigurationFile which delegates special entry resolution to this class.- Throws:
ConfigurationException
-
AggregateConfig
Create an AggregateConfig- Parameters:
configs- An array of configArgs, where the common config is specified as the last element of the array. The first element of the array defines the config which may may declare entries of the form $component_entry. These entries will be resolved in the "common" Configuration. Parsing of the end config would be done by ConfigurationFile which delegates special entry resolution to this class.loader- - The class loader to use for interpreting class names- Throws:
ConfigurationException
-
-
Method Details
-
getCommonConfiguration
Get the common configuration this class was created with- Returns:
- The common
Configurationobject.
-
getEntry
Description copied from interface:ConfigurationReturns an object of the specified type created using the information in the entry matching the specified component and name, which must be found, and supplying no data. Iftypeis a primitive type, then the result is returned as an instance of the associated wrapper class. Repeated calls with the same arguments may or may not return the identical object.The
componentidentifies the object whose behavior will be configured using the object returned. The value ofcomponentmust be a QualifiedIdentifier, as defined in the Java(TM) Language Specification (JLS), and is typically the class or package name of the object being configured. Thenameidentifies which of possibly several entries are available for the given component. The value ofnamemust be an Identifier, as defined in the JLS.Calling this method is equivalent to calling
.getEntry(component, name, type,Configuration.NO_DEFAULT,Configuration.NO_DATA)- Specified by:
getEntryin interfaceConfiguration- Parameters:
component- the component being configuredname- the name of the entry for the componenttype- the type of the object to be returned- Returns:
- an object created using the information in the entry matching
componentandname - Throws:
NoSuchEntryException- if no matching entry is foundConfigurationException- if a matching entry is found but a problem occurs creating the object for the entry, or iftypeis a reference type and the result for the matching entry is not eithernullor an instance oftype, or iftypeis a primitive type and the result is not an instance of the associated wrapper class. AnyErrorthrown while creating the object is propagated to the caller; it is not wrapped in aConfigurationException.- See Also:
-
getEntry
public Object getEntry(String component, String name, Class type, Object defaultValue) throws ConfigurationException Description copied from interface:ConfigurationReturns an object of the specified type created using the information in the entry matching the specified component and name, and supplying no data, returning the default value if no matching entry is found and the default value is notConfiguration.NO_DEFAULT. Iftypeis a primitive type, then the result is returned as an instance of the associated wrapper class. Repeated calls with the same arguments may or may not return the identical object.The
componentidentifies the object whose behavior will be configured using the object returned. The value ofcomponentmust be a QualifiedIdentifier, as defined in the Java Language Specification (JLS), and is typically the class or package name of the object being configured. Thenameidentifies which of possibly several entries are available for the given component. The value ofnamemust be an Identifier, as defined in the JLS.Calling this method is equivalent to calling
.getEntry(component, name, type, defaultValue,Configuration.NO_DATA)- Specified by:
getEntryin interfaceConfiguration- Parameters:
component- the component being configuredname- the name of the entry for the componenttype- the type of the object to be returneddefaultValue- the object to return if no matching entry is found, orNO_DEFAULTto specify no default- Returns:
- an object created using the information in the entry matching
componentandname, ordefaultValueif no matching entry is found anddefaultValueis notNO_DEFAULT - Throws:
NoSuchEntryException- if no matching entry is found anddefaultValueisNO_DEFAULTConfigurationException- if a matching entry is found but a problem occurs creating the object for the entry, or iftypeis a reference type and the result for the matching entry is not eithernullor an instance oftype, or iftypeis a primitive type and the result is not an instance of the associated wrapper class. AnyErrorthrown while creating the object is propagated to the caller; it is not wrapped in aConfigurationException.- See Also:
-
getEntry
public Object getEntry(String component, String name, Class type, Object defaultValue, Object data) throws ConfigurationException Description copied from interface:ConfigurationReturns an object of the specified type created using the information in the entry matching the specified component and name, and using the specified data (unless it isConfiguration.NO_DATA), returning the default value if no matching entry is found and the default value is notConfiguration.NO_DEFAULT. Iftypeis a primitive type, then the result is returned as an instance of the associated wrapper class. Repeated calls with the same arguments may or may not return the identical object.The
componentidentifies the object whose behavior will be configured using the object returned. The value ofcomponentmust be a QualifiedIdentifier, as defined in the Java Language Specification (JLS), and is typically the class or package name of the object being configured. Thenameidentifies which of possibly several entries are available for the given component. The value ofnamemust be an Identifier, as defined in the JLS.- Specified by:
getEntryin interfaceConfiguration- Parameters:
component- the component being configuredname- the name of the entry for the componenttype- the type of the object to be returneddefaultValue- the object to return if no matching entry is found, orNO_DEFAULTto specify no defaultdata- an object to use when computing the value of the entry, orNO_DATAto specify no data- Returns:
- an object created using the information in the entry matching
componentandname, and using the value ofdata(unless it isNO_DATA), ordefaultValueif no matching entry is found anddefaultValueis notNO_DEFAULT - Throws:
NoSuchEntryException- if no matching entry is found anddefaultValueisNO_DEFAULTConfigurationException- if a matching entry is found but a problem occurs creating the object for the entry, or iftypeis a reference type and the result for the matching entry is not eithernullor an instance oftype, or iftypeis a primitive type and the result is not an instance of the associated wrapper class. AnyErrorthrown while creating the object is propagated to the caller; it is not wrapped in aConfigurationException.
-