Class AggregateConfig

java.lang.Object
net.jini.config.AggregateConfig
All Implemented Interfaces:
Configuration

public class AggregateConfig extends Object implements Configuration
  • Constructor Details

    • AggregateConfig

      public AggregateConfig(Configuration config, String[] configArgs) throws ConfigurationException
      Create an AggregateConfig
      Parameters:
      config - The "common" Configuration
      configArgs - 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" Configuration
      configArgs - - 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

      public AggregateConfig(String[] configs) throws ConfigurationException
      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

      public AggregateConfig(String[] configs, ClassLoader loader) throws ConfigurationException
      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

      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
      Description copied from interface: Configuration
      Returns 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. If type is 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 component identifies the object whose behavior will be configured using the object returned. The value of component must 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. The name identifies which of possibly several entries are available for the given component. The value of name must 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:
      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
      Throws:
      NoSuchEntryException - if no matching entry is found
      ConfigurationException - if a matching entry is found but a problem occurs creating the object for the entry, or if type is a reference type and the result for the matching entry is not either null or an instance of type, or if type is a primitive type and the result is not an instance of the associated wrapper class. Any Error thrown while creating the object is propagated to the caller; it is not wrapped in a ConfigurationException.
      See Also:
    • getEntry

      public Object getEntry(String component, String name, Class type, Object defaultValue) throws ConfigurationException
      Description copied from interface: Configuration
      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 not Configuration.NO_DEFAULT. If type is 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 component identifies the object whose behavior will be configured using the object returned. The value of component must be a QualifiedIdentifier, as defined in the Java Language Specification (JLS), and is typically the class or package name of the object being configured. The name identifies which of possibly several entries are available for the given component. The value of name must 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:
      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, or defaultValue if no matching entry is found and defaultValue is not NO_DEFAULT
      Throws:
      NoSuchEntryException - if no matching entry is found and defaultValue is NO_DEFAULT
      ConfigurationException - if a matching entry is found but a problem occurs creating the object for the entry, or if type is a reference type and the result for the matching entry is not either null or an instance of type, or if type is a primitive type and the result is not an instance of the associated wrapper class. Any Error thrown while creating the object is propagated to the caller; it is not wrapped in a ConfigurationException.
      See Also:
    • getEntry

      public Object getEntry(String component, String name, Class type, Object defaultValue, Object data) throws ConfigurationException
      Description copied from interface: Configuration
      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 is Configuration.NO_DATA), returning the default value if no matching entry is found and the default value is not Configuration.NO_DEFAULT. If type is 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 component identifies the object whose behavior will be configured using the object returned. The value of component must be a QualifiedIdentifier, as defined in the Java Language Specification (JLS), and is typically the class or package name of the object being configured. The name identifies which of possibly several entries are available for the given component. The value of name must be an Identifier, as defined in the JLS.

      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:
      NoSuchEntryException - if no matching entry is found and defaultValue is NO_DEFAULT
      ConfigurationException - if a matching entry is found but a problem occurs creating the object for the entry, or if type is a reference type and the result for the matching entry is not either null or an instance of type, or if type is a primitive type and the result is not an instance of the associated wrapper class. Any Error thrown while creating the object is propagated to the caller; it is not wrapped in a ConfigurationException.