Hi,

This is a collection of all the previous patches to info/containerkit patches. 
After this is applied I am almost ready to start auto-assembly :)

It does a bunch of things. Basically it adds support for "Partitions" which 
are groupings of components that are operated on in concert. ie The listeners 
in phoenix would be one partition and the blocks would be another. Nothing 
particularly earth shattering and it essentially follows the design of HP's 
CSF.

The patch also copies back the array/map dependency stuff from phoenix into 
containerkit.

It also adds the notion of attributes to the metadata/assembly declarations.

It also vastly imprves the memory management not requiring so many 
instantiations and dealing with nulls in some cases and defining empty arrays 
in others.

It also vastly improves the support for handling BlockInfo style metadata, 
including offering writing support.

Also implements proper mapping of phoenix style short names for schema (ie 
relax-ng) ro uri based names (ie http://www.relaxng ....). Which makes it 
easier to support a larger variety of schema languages to be used in the 
future.

To apply do

$ cd jakarta-avalon-phoenix
$ patch -p0 < info-ck.txt
$ mv LegacyUtil.java 
info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyUtil.java
$ mv LegacyBlockInfoWriter.java 
info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoWriter.java
$ mv PartitionProfile.java 
containerkit/src/java/org/apache/excalibur/containerkit/registry/PartitionProfile.java
$ mv ProfileBuilder.java 
containerkit/src/java/org/apache/excalibur/containerkit/registry/ProfileBuilder.java
$ mv PartitionMetaData.java 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/PartitionMetaData.java


-- 
Cheers,

Peter Donald
----------------------------------------
Why does everyone always overgeneralize?
---------------------------------------- 
? info-ck.txt
? stuff
? 
containerkit/src/java/org/apache/excalibur/containerkit/registry/PartitionProfile.java
? 
containerkit/src/java/org/apache/excalibur/containerkit/registry/ProfileBuilder.java
? 
info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoWriter.java
? info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyUtil.java
Index: containerkit/default.properties
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/default.properties,v
retrieving revision 1.5
diff -u -r1.5 default.properties
--- containerkit/default.properties     16 Nov 2002 12:08:50 -0000      1.5
+++ containerkit/default.properties     28 Nov 2002 08:10:03 -0000
@@ -8,7 +8,7 @@
 name=excalibur-containerkit
 Name=Excalibur ContainerKit
 dir-name=containerkit
-version=1.0
+version=1.0a
 package-version=0.99
 year=2000-2002
 
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleMetaDataBuilder.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleMetaDataBuilder.java,v
retrieving revision 1.1
diff -u -r1.1 SimpleMetaDataBuilder.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleMetaDataBuilder.java
     23 Aug 2002 08:51:15 -0000      1.1
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleMetaDataBuilder.java
     28 Nov 2002 08:10:03 -0000
@@ -8,12 +8,15 @@
 package org.apache.excalibur.containerkit.demo;
 
 import java.util.ArrayList;
+import java.util.Map;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
+import org.apache.avalon.framework.info.Attribute;
 import org.apache.excalibur.containerkit.metadata.ComponentMetaData;
 import org.apache.excalibur.containerkit.metadata.DependencyMetaData;
 import org.apache.excalibur.containerkit.metadata.MetaDataBuilder;
+import org.apache.excalibur.containerkit.metadata.PartitionMetaData;
 import org.xml.sax.InputSource;
 
 /**
@@ -26,7 +29,20 @@
 public class SimpleMetaDataBuilder
     implements MetaDataBuilder
 {
-    public ComponentMetaData[] loadMetaData( final String location )
+    public static final String CONFIG_LOCATION = "simple:location";
+
+    public PartitionMetaData buildAssembly( final Map parameters )
+        throws Exception
+    {
+        final String location = (String)parameters.get( CONFIG_LOCATION );
+        final ComponentMetaData[] components = loadMetaData( location );
+        return new PartitionMetaData( "main", new String[ 0 ],
+                                      new PartitionMetaData[ 0 ],
+                                      components,
+                                      Attribute.EMPTY_SET );
+    }
+
+    private ComponentMetaData[] loadMetaData( final String location )
         throws Exception
     {
         final DefaultConfigurationBuilder builder = new 
DefaultConfigurationBuilder();
@@ -62,7 +78,7 @@
         final DependencyMetaData[] dependencies =
             parseAssociations( component.getChildren( "provide" ) );
 
-        return new ComponentMetaData( name, impl, dependencies, null, config );
+        return new ComponentMetaData( name, impl, dependencies, null, config, 
null );
     }
 
     private DependencyMetaData[] parseAssociations( final Configuration[] 
provides )
@@ -72,9 +88,10 @@
         for( int i = 0; i < provides.length; i++ )
         {
             final Configuration provide = provides[ i ];
-            final String role = provide.getAttribute( "role" );
-            final String provider = provide.getAttribute( "name" );
-            final DependencyMetaData association = new DependencyMetaData( 
role, provider );
+            final String key = provide.getAttribute( "key" );
+            final String provider = provide.getAttribute( "provider" );
+            final DependencyMetaData association =
+                new DependencyMetaData( key, provider, key, 
Attribute.EMPTY_SET );
             associations.add( association );
         }
         return (DependencyMetaData[])associations.toArray( new 
DependencyMetaData[ associations.size() ] );
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleServiceKernel.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleServiceKernel.java,v
retrieving revision 1.2
diff -u -r1.2 SimpleServiceKernel.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleServiceKernel.java
       2 Oct 2002 01:52:19 -0000       1.2
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/demo/SimpleServiceKernel.java
       28 Nov 2002 08:10:03 -0000
@@ -18,6 +18,9 @@
 import org.apache.excalibur.containerkit.lifecycle.ResourceProvider;
 import org.apache.excalibur.containerkit.metadata.ComponentMetaData;
 import org.apache.excalibur.containerkit.metadata.MetaDataBuilder;
+import org.apache.excalibur.containerkit.metadata.PartitionMetaData;
+import java.util.Map;
+import java.util.HashMap;
 
 /**
  * This is a simple ServiceKernel.
@@ -53,7 +56,10 @@
         m_metaDataBuilder = new SimpleMetaDataBuilder();
         setupLogger( getFactory(), "builder" );
 
-        final ComponentMetaData[] components = m_metaDataBuilder.loadMetaData( 
m_configURL );
+        final Map parameters = new HashMap();
+        parameters.put( SimpleMetaDataBuilder.CONFIG_LOCATION, m_configURL );
+        final PartitionMetaData partition = m_metaDataBuilder.buildAssembly( 
parameters );
+        final ComponentMetaData[] components = partition.getComponents();
         for( int i = 0; i < components.length; i++ )
         {
             final ComponentMetaData component = components[ i ];
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/kernel/processor/DependencyMap.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/processor/DependencyMap.java,v
retrieving revision 1.2
diff -u -r1.2 DependencyMap.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/kernel/processor/DependencyMap.java
 2 Oct 2002 01:52:19 -0000       1.2
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/kernel/processor/DependencyMap.java
 28 Nov 2002 08:10:12 -0000
@@ -217,12 +217,12 @@
         for( int i = 0; i < entrySet.length; i++ )
         {
             final ComponentProfile other = entrySet[ i ];
-            final DependencyMetaData[] roles =
+            final DependencyMetaData[] dependencies =
                 other.getMetaData().getDependencies();
 
-            for( int j = 0; j < roles.length; j++ )
+            for( int j = 0; j < dependencies.length; j++ )
             {
-                final String depends = roles[ j ].getProviderName();
+                final String depends = dependencies[ j ].getProviderName();
                 if( depends.equals( name ) )
                 {
                     visitcomponent( other, false, done, order, store );
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/AbstractResourceProvider.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/AbstractResourceProvider.java,v
retrieving revision 1.19
diff -u -r1.19 AbstractResourceProvider.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/AbstractResourceProvider.java
        16 Nov 2002 13:09:33 -0000      1.19
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/AbstractResourceProvider.java
        28 Nov 2002 08:10:13 -0000
@@ -339,7 +339,7 @@
 
     /**
      * Create a Map of services for specified component.
-     * The map maps role name to service provider.
+     * The map maps key name to service provider.
      *
      * @param componentEntry the component entry creating map for
      * @return the map
@@ -359,9 +359,9 @@
         for( int i = 0; i < dependencies.length; i++ )
         {
             final DependencyMetaData dependency = dependencies[ i ];
-            final String role = dependency.getRole();
+            final String key = dependency.getKey();
             final String providerName = dependency.getProviderName();
-            final boolean optional = info.getDependency( role ).isOptional();
+            final boolean optional = info.getDependency( key ).isOptional();
 
             final Object service =
                 getService( providerName, componentEntry );
@@ -370,7 +370,7 @@
                 final String message =
                     REZ.getString( "resource.missing-dependency.error",
                                    optional ? "1" : "2",
-                                   role,
+                                   key,
                                    component.getName() );
                 if( !optional )
                 {
@@ -383,7 +383,7 @@
                 }
             }
 
-            services.put( role, service );
+            services.put( key, service );
         }
 
         return services;
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/Resource.properties
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/Resource.properties,v
retrieving revision 1.2
diff -u -r1.2 Resource.properties
--- 
containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/Resource.properties
  25 Jun 2002 04:32:29 -0000      1.2
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/Resource.properties
  28 Nov 2002 08:10:13 -0000
@@ -1,7 +1,7 @@
 resource.missing-context-value.error=Missing {0,choice,1#Optional|2#Required} 
Context Entry with key "{1}" for component named "{2}".
 resource.bad-value-type.error=Bad value retrieved for 
{0,choice,1#Optional|2#Required} Context Entry with key "{1}" for component 
named "{2}". Expected to be of type "{3}" but was of type "{4}".
 resource.bad-context-type.error=The class of Contex object for component named 
"{2}" was expected to be of type {0} but was of tpye {1}.
-resource.service-not-a-component.error=The service with role "0" and 
implemenation class "{1}" does not implement the Component interface but is 
being exposed via ComponentManager.
-resource.missing-dependency.error=Missing {0,choice,1#Optional|2#Required} 
dependency with role "{1}" for component named {2}.
+resource.service-not-a-component.error=The service with key "0" and 
implemenation class "{1}" does not implement the Component interface but is 
being exposed via ComponentManager.
+resource.missing-dependency.error=Missing {0,choice,1#Optional|2#Required} 
dependency with key "{1}" for component named {2}.
 resource.missing-parameters.error=Missing Parameters object for component 
named "{0}".
 resource.missing-parameters.error=Missing Configuration for component named 
"{0}".
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/ComponentMetaData.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/ComponentMetaData.java,v
retrieving revision 1.13
diff -u -r1.13 ComponentMetaData.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/ComponentMetaData.java
     18 Aug 2002 03:34:28 -0000      1.13
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/ComponentMetaData.java
     28 Nov 2002 08:10:13 -0000
@@ -8,11 +8,13 @@
 package org.apache.excalibur.containerkit.metadata;
 
 import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.info.Attribute;
+import org.apache.avalon.framework.info.FeatureDescriptor;
 import org.apache.avalon.framework.parameters.Parameters;
 
 /**
  * Each component declared in the application is represented by
- * a ComponentPolicy. Note that this does not necessarily imply
+ * a ComponentMetaData. Note that this does not necessarily imply
  * that there is only one instance of actual component. The
  * ComponentMetaData could represent a pool of components, a single
  * component or a component prototype that is reused to create
@@ -22,8 +24,15 @@
  * @version $Revision: 1.13 $ $Date: 2002/08/18 03:34:28 $
  */
 public class ComponentMetaData
+    extends FeatureDescriptor
 {
     /**
+     * The name of the component. This is an
+     * abstract name used during assembly.
+     */
+    private final String m_name;
+
+    /**
      * The implementationKey for this component.
      * Usually this represents a classname but
      * alternative mechanisms could be used (ie URL
@@ -32,12 +41,6 @@
     private final String m_implementationKey;
 
     /**
-     * The name of the component. This is an
-     * abstract name used during assembly.
-     */
-    private final String m_name;
-
-    /**
      * The resolution of any dependencies required by
      * the component type.
      */
@@ -57,14 +60,20 @@
      * Create a ComponentMetaData.
      *
      * @param name the abstract name of component meta data instance
+     * @param implementationKey the key used to create component (usually a 
classname)
      * @param dependencies the meta data for any dependencies
+     * @param parameters the parameters that the component will be provided 
(may be null)
+     * @param configuration the configuration that the component will be 
provided (may be null)
+     * @param attributes the extra attributes that are used to describe 
component
      */
     public ComponentMetaData( final String name,
                               final String implementationKey,
                               final DependencyMetaData[] dependencies,
                               final Parameters parameters,
-                              final Configuration configuration )
+                              final Configuration configuration,
+                              final Attribute[] attributes )
     {
+        super( attributes );
         if( null == name )
         {
             throw new NullPointerException( "name" );
@@ -86,9 +95,9 @@
     }
 
     /**
-     * Return the name of component profile.
+     * Return the name of component metadata.
      *
-     * @return the name of the component profile.
+     * @return the name of the component metadata.
      */
     public String getName()
     {
@@ -136,15 +145,15 @@
     }
 
     /**
-     * Return the dependency for component with specified role.
+     * Return the dependency for component with specified key.
      *
-     * @return the dependency for component with specified role.
+     * @return the dependency for component with specified key.
      */
-    public DependencyMetaData getDependency( final String role )
+    public DependencyMetaData getDependency( final String key )
     {
         for( int i = 0; i < m_dependencies.length; i++ )
         {
-            if( m_dependencies[ i ].getRole().equals( role ) )
+            if( m_dependencies[ i ].getKey().equals( key ) )
             {
                 return m_dependencies[ i ];
             }
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/DependencyMetaData.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/DependencyMetaData.java,v
retrieving revision 1.10
diff -u -r1.10 DependencyMetaData.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/DependencyMetaData.java
    2 Oct 2002 01:46:57 -0000       1.10
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/DependencyMetaData.java
    28 Nov 2002 08:10:13 -0000
@@ -7,12 +7,15 @@
  */
 package org.apache.excalibur.containerkit.metadata;
 
+import org.apache.avalon.framework.info.FeatureDescriptor;
+import org.apache.avalon.framework.info.Attribute;
+
 /**
  * The [EMAIL PROTECTED] DependencyMetaData} is the mapping of a component as 
a dependency
  * of another component. Each component declares dependencies (via
  * [EMAIL PROTECTED] org.apache.avalon.framework.info.ComponentInfo})
  * and for each dependency there must be a coressponding DependencyMetaData 
which
- * has a matching role. The name value in [EMAIL PROTECTED] 
DependencyMetaData} object must refer
+ * has a matching key. The name value in [EMAIL PROTECTED] DependencyMetaData} 
object must refer
  * to another Component that implements a service as specified in 
DependencyInfo.
  *
  * <p>Note that it is invalid to have circular dependencies.</p>
@@ -22,11 +25,12 @@
  * @version $Revision: 1.10 $ $Date: 2002/10/02 01:46:57 $
  */
 public final class DependencyMetaData
+    extends FeatureDescriptor
 {
     /**
-     * The name that the client component will use to access a dependency.
+     * The key that the client component will use to access a dependency.
      */
-    private final String m_role;
+    private final String m_key;
 
     /**
      * the name of the component profile that represents a component
@@ -35,29 +39,52 @@
     private final String m_providerName;
 
     /**
-     * Create Association between role and provider.
+     * The key that is used when the dependency is a map dependency.
+     * Usually this defaults to the same value as the key.
+     */
+    private final String m_alias;
+
+    /**
+     * Create Association between key and provider.
      *
-     * @param role the name client uses to access component
+     * @param key the key the client uses to access component
      * @param providerName the name of [EMAIL PROTECTED] ComponentMetaData}
      *   that is associated as a service provider
      */
-    public DependencyMetaData( final String role,
-                               final String providerName )
+    public DependencyMetaData( final String key,
+                               final String providerName,
+                               final String alias,
+                               final Attribute[] attributes )
     {
-        m_role = role;
+        super( attributes );
+
+        if( null == key )
+        {
+            throw new NullPointerException( "key" );
+        }
+        if( null == providerName )
+        {
+            throw new NullPointerException( "providerName" );
+        }
+        if( null == alias )
+        {
+            throw new NullPointerException( "alias" );
+        }
+        m_key = key;
         m_providerName = providerName;
+        m_alias = alias;
     }
 
     /**
-     * Return the name that will be used by a component instance to access a
+     * Return the key that will be used by a component instance to access a
      * dependent service.
      *
      * @return the name that the client component will use to access 
dependency.
      * @see org.apache.avalon.framework.service.ServiceManager#lookup( String )
      */
-    public String getRole()
+    public String getKey()
     {
-        return m_role;
+        return m_key;
     }
 
     /**
@@ -69,5 +96,17 @@
     public String getProviderName()
     {
         return m_providerName;
+    }
+
+    /**
+     * The key under which the dependency is placed in map if dependency is
+     * a Map dependency.
+     *
+     * @return the key under which the dependency is placed in map if 
dependency is
+     *         a Map dependency.
+     */
+    public String getAlias()
+    {
+        return m_alias;
     }
 }
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/MetaDataBuilder.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/MetaDataBuilder.java,v
retrieving revision 1.2
diff -u -r1.2 MetaDataBuilder.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/MetaDataBuilder.java
       2 Oct 2002 01:52:19 -0000       1.2
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/MetaDataBuilder.java
       28 Nov 2002 08:10:13 -0000
@@ -7,11 +7,11 @@
  */
 package org.apache.excalibur.containerkit.metadata;
 
-
+import java.util.Map;
 
 /**
- * Load metadata from some source. The source is usually
- * one or more xml config files.
+ * Load metadata for an Assembly from some source.
+ * The source is usually one or more xml config files.
  *
  * @author <a href="mailto:peter at apache.org">Peter Donald</a>
  * @version $Revision: 1.2 $ $Date: 2002/10/02 01:52:19 $
@@ -20,15 +20,14 @@
 {
     /**
      * Load metadata from a particular source
-     * defined by location string. The format of
-     * location string and format of source loaded
-     * from is left unspecified.
+     * using specified map of parameters. The content
+     * of the parameters is left unspecified.
      *
-     * @param location the location of meta data source
+     * @param parameters the parameters indicating method to load meta data 
source
      * @return the set of components in metadata
-     * @throws java.lang.Exception if unable to load or resolve meta
-     *         data for any reason
+     * @throws Exception if unable to load or resolve
+     *         meta data for any reason
      */
-    ComponentMetaData[] loadMetaData( String location )
+    PartitionMetaData buildAssembly( Map parameters )
         throws Exception;
 }
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/package.html
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/package.html,v
retrieving revision 1.2
diff -u -r1.2 package.html
--- 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/package.html   
    6 Jul 2002 01:13:01 -0000       1.2
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/metadata/package.html   
    28 Nov 2002 08:10:13 -0000
@@ -1,5 +1,4 @@
-
 <body>
 A set of classes supporting the representation of information about a
-component profile.
+component assembly.
 </body>
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/registry/ComponentProfile.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/registry/ComponentProfile.java,v
retrieving revision 1.1
diff -u -r1.1 ComponentProfile.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/registry/ComponentProfile.java
      24 Aug 2002 08:49:03 -0000      1.1
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/registry/ComponentProfile.java
      28 Nov 2002 08:10:13 -0000
@@ -27,6 +27,7 @@
      * the type of this component.
      */
     private final ComponentInfo m_info;
+    
     /**
      * The [EMAIL PROTECTED] ComponentMetaData} that describes
      * this component.
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/verifier/AssemblyVerifier.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/AssemblyVerifier.java,v
retrieving revision 1.40
diff -u -r1.40 AssemblyVerifier.java
--- 
containerkit/src/java/org/apache/excalibur/containerkit/verifier/AssemblyVerifier.java
      12 Nov 2002 01:39:42 -0000      1.40
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/verifier/AssemblyVerifier.java
      28 Nov 2002 08:10:13 -0000
@@ -37,7 +37,7 @@
  *       from Component B then Component B must provide Service S.</li>
  *   <li>Verify that there are no circular dependendencies between
  *       components.</li>
- *   <li>Verify that the Class objects for Component implement the
+ *   <li>Verify that the Class objects for component implement the
  *       service interfaces.</li>
  *   <li>Verify that the Class is a valid Avalon Component as per the
  *       rules in [EMAIL PROTECTED] 
org.apache.avalon.framework.tools.verifier.ComponentVerifier} object.</li>
@@ -245,13 +245,14 @@
         throws VerifyException
     {
         final ComponentInfo info = component.getInfo();
-        final DependencyMetaData[] roles = 
component.getMetaData().getDependencies();
+        final DependencyMetaData[] dependencies = 
component.getMetaData().getDependencies();
 
-        for( int i = 0; i < roles.length; i++ )
+        for( int i = 0; i < dependencies.length; i++ )
         {
-            final String providerName = roles[ i ].getProviderName();
-            final String roleName = roles[ i ].getRole();
-            final String implementationKey = info.getDependency( roleName 
).getType();
+            final DependencyMetaData dependency = dependencies[ i ];
+            final String providerName = dependency.getProviderName();
+            final String key = dependency.getKey();
+            final String type = info.getDependency( key ).getType();
 
             //Get the other component that is providing service
             final ComponentProfile provider = getComponentProfile( 
providerName, others );
@@ -259,7 +260,7 @@
             {
                 final String message =
                     REZ.getString( "assembly.missing-dependency.error",
-                                   roleName,
+                                   key,
                                    providerName,
                                    component.getMetaData().getName() );
                 throw new VerifyException( message );
@@ -269,12 +270,12 @@
             //that user expects it to be providing
             final ComponentInfo providerInfo = provider.getInfo();
             final ServiceDescriptor[] services = providerInfo.getServices();
-            if( !hasMatchingService( implementationKey, services ) )
+            if( !hasMatchingService( type, services ) )
             {
                 final String message =
                     REZ.getString( "assembly.dependency-missing-service.error",
                                    providerName,
-                                   implementationKey,
+                                   type,
                                    component.getMetaData().getName() );
                 throw new VerifyException( message );
             }
@@ -404,15 +405,15 @@
     protected void verifyDependenciesMap( final ComponentProfile component )
         throws VerifyException
     {
-        //Make sure all role entries specified in config file are valid
+        //Make sure all dependency entries specified in config file are valid
         final DependencyMetaData[] dependencySet =
             component.getMetaData().getDependencies();
 
         for( int i = 0; i < dependencySet.length; i++ )
         {
-            final String roleName = dependencySet[ i ].getRole();
+            final String key = dependencySet[ i ].getKey();
             final ComponentInfo info = component.getInfo();
-            final DependencyDescriptor descriptor = info.getDependency( 
roleName );
+            final DependencyDescriptor descriptor = info.getDependency( key );
 
             //If there is no dependency descriptor in ComponentInfo then
             //user has specified an uneeded dependency.
@@ -420,8 +421,8 @@
             {
                 final String message =
                     REZ.getString( "assembly.unknown-dependency.error",
-                                   roleName,
-                                   roleName,
+                                   key,
+                                   key,
                                    component.getMetaData().getName() );
                 throw new VerifyException( message );
             }
@@ -433,12 +434,12 @@
         for( int i = 0; i < dependencies.length; i++ )
         {
             final DependencyDescriptor dependency = dependencies[ i ];
-            final DependencyMetaData role =
+            final DependencyMetaData dependencyMetaData =
                 component.getMetaData().getDependency( dependency.getKey() );
 
-            //If there is no Role then the user has failed
+            //If there is no metaData then the user has failed
             //to specify a needed dependency.
-            if( null == role && !dependency.isOptional() )
+            if( null == dependencyMetaData && !dependency.isOptional() )
             {
                 final String message =
                     REZ.getString( "assembly.unspecified-dependency.error",
@@ -453,19 +454,18 @@
      * Return true if specified service reference matches any of the
      * candidate services.
      *
-     * @param implementationKey the service implementationKey
+     * @param type the service type
      * @param candidates an array of candidate services
      * @return true if candidate services contains a service that matches
      *         specified service, false otherwise
      */
-    protected boolean hasMatchingService( final String implementationKey,
+    protected boolean hasMatchingService( final String type,
                                           final ServiceDescriptor[] candidates 
)
     {
         for( int i = 0; i < candidates.length; i++ )
         {
-            final String otherClassname =
-                candidates[ i ].getImplementationKey();
-            if( otherClassname.equals( implementationKey ) )
+            final String otherClassname = candidates[ i ].getType();
+            if( otherClassname.equals( type ) )
             {
                 return true;
             }
Index: 
containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties,v
retrieving revision 1.11
diff -u -r1.11 Resources.properties
--- 
containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties
       14 Sep 2002 06:21:00 -0000      1.11
+++ 
containerkit/src/java/org/apache/excalibur/containerkit/verifier/Resources.properties
       28 Nov 2002 08:10:13 -0000
@@ -6,11 +6,11 @@
 assembly.nocircular-dependencies.notice=Verifying that there are no circular 
dependencies between Components.
 assembly.component-type.notice=Verifying that the specified Components have 
valid types.
 assembly.circular-dependency.error=Component named "{0}" has a circular 
dependency via path: {1}.
-assembly.missing-dependency.error=Component "{1}" that satisfies the 
dependency with role "{0}" of Component "{2}" does not exist.
+assembly.missing-dependency.error=Component "{1}" that satisfies the 
dependency with key "{0}" of Component "{2}" does not exist.
 assembly.dependency-missing-service.error=Dependency "{0}" of Block "{2}" does 
not offer the required service "{1}".
 assembly.bad-class.error=Unable to load class "{1}" for Component named "{0}". 
(Reason: {2}).
 assembly.bad-name.error=The Component name "{0}" is invalid. Valid names 
contain only letters, digits and the '-' character.
 assembly.duplicate-name.error=The name "{0}" is used by multiple Components in 
assembly.
-assembly.unknown-dependency.error=Unknown dependency named "{0}" with role 
"{1}" declared for Component {2}.
-assembly.unspecified-dependency.error=Dependency for role "{0}" not specified 
for the Component named "{1}".
+assembly.unknown-dependency.error=Unknown dependency named "{0}" with key 
"{1}" declared for Component {2}.
+assembly.unspecified-dependency.error=Dependency for key "{0}" not specified 
for the Component named "{1}".
 error=Component named "{0}" of type "{1}" is not Contextualizable but declares 
Context Entrys.
Index: info/src/java/org/apache/avalon/framework/info/Attribute.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/Attribute.java,v
retrieving revision 1.6
diff -u -r1.6 Attribute.java
--- info/src/java/org/apache/avalon/framework/info/Attribute.java       11 Nov 
2002 23:56:53 -0000      1.6
+++ info/src/java/org/apache/avalon/framework/info/Attribute.java       28 Nov 
2002 08:10:17 -0000
@@ -24,7 +24,15 @@
 public final class Attribute
     implements Serializable
 {
-    private static final String[] EMPTY_SET = new String[ 0 ];
+    /**
+     * An empty array of attributes.
+     */
+    public static final Attribute[] EMPTY_SET = new Attribute[ 0 ];
+
+    /**
+     * To save memory always return same emtpy array of names
+     */
+    private static final String[] EMPTY_NAME_SET = new String[ 0 ];
 
     /**
      * The name of the Attribute.
@@ -49,10 +57,6 @@
         {
             throw new NullPointerException( "name" );
         }
-        if( null == parameters )
-        {
-            throw new NullPointerException( "parameters" );
-        }
 
         m_name = name;
         m_parameters = parameters;
@@ -112,16 +116,23 @@
     {
         if( null == m_parameters )
         {
-            return EMPTY_SET;
+            return EMPTY_NAME_SET;
         }
         else
         {
-            return (String[])m_parameters.keySet().toArray( EMPTY_SET );
+            return (String[])m_parameters.keySet().toArray( EMPTY_NAME_SET );
         }
     }
 
     public String toString()
     {
-        return getName() + m_parameters;
+        if( null != m_parameters )
+        {
+            return getName() + m_parameters;
+        }
+        else
+        {
+            return getName();
+        }
     }
 }
Index: info/src/java/org/apache/avalon/framework/info/ComponentInfo.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentInfo.java,v
retrieving revision 1.8
diff -u -r1.8 ComponentInfo.java
--- info/src/java/org/apache/avalon/framework/info/ComponentInfo.java   24 Nov 
2002 12:15:26 -0000      1.8
+++ info/src/java/org/apache/avalon/framework/info/ComponentInfo.java   28 Nov 
2002 08:10:18 -0000
@@ -203,7 +203,7 @@
     {
         for( int i = 0; i < m_services.length; i++ )
         {
-            final String otherClassname = m_services[ i 
].getImplementationKey();
+            final String otherClassname = m_services[ i ].getType();
             if( otherClassname.equals( classname ) )
             {
                 return m_services[ i ];
Index: info/src/java/org/apache/avalon/framework/info/ContextDescriptor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ContextDescriptor.java,v
retrieving revision 1.10
diff -u -r1.10 ContextDescriptor.java
--- info/src/java/org/apache/avalon/framework/info/ContextDescriptor.java       
29 Sep 2002 04:13:47 -0000      1.10
+++ info/src/java/org/apache/avalon/framework/info/ContextDescriptor.java       
28 Nov 2002 08:10:18 -0000
@@ -30,6 +30,18 @@
     extends FeatureDescriptor
 {
     /**
+     * The default type of the context.
+     */
+    public static final String DEFAULT_TYPE =
+        "org.apache.avalon.framework.context.Context";
+
+    /**
+     * A constant for an empty context with standard type.
+     */
+    public static final ContextDescriptor EMPTY_CONTEXT =
+        new ContextDescriptor( DEFAULT_TYPE, EntryDescriptor.EMPTY_SET, 
Attribute.EMPTY_SET );
+
+    /**
      * The type of the context. (ie a name of the context
      * interface that is required by the component).
      */
Index: info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java,v
retrieving revision 1.11
diff -u -r1.11 DependencyDescriptor.java
--- info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java    
12 Nov 2002 01:33:14 -0000      1.11
+++ info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java    
28 Nov 2002 08:10:18 -0000
@@ -36,6 +36,21 @@
     extends FeatureDescriptor
 {
     /**
+     * Constant with empty set of dependencys.
+     */
+    public static final DependencyDescriptor[] EMPTY_SET = new 
DependencyDescriptor[ 0 ];
+
+    /**
+     * The postfix indicating an array type.
+     */
+    public static final String ARRAY_POSTFIX = "[]";
+
+    /**
+     * The postfix indicating a "Map" type.
+     */
+    public static final String MAP_POSTFIX = "{}";
+
+    /**
      * The name the component uses to lookup dependency.
      */
     private final String m_key;
@@ -104,6 +119,52 @@
     public boolean isOptional()
     {
         return m_optional;
+    }
+
+    /**
+     * Return true if dependency type is an array.
+     *
+     * @return true if dependency type is an array.
+     */
+    public boolean isArray()
+    {
+        return getType().endsWith( ARRAY_POSTFIX );
+    }
+
+    /**
+     * Return true if dependency type is a map.
+     *
+     * @return true if dependency type is a map.
+     */
+    public boolean isMap()
+    {
+        return getType().endsWith( MAP_POSTFIX );
+    }
+
+    /**
+     * Return the type of component type if the service
+     * is an array or Map Service. Otherwise just return the
+     * name of service.
+     *
+     * @return the Service component type
+     */
+    public String getComponentType()
+    {
+        final String fullname = getType();
+        if( isArray() )
+        {
+            final int end = fullname.length() - ARRAY_POSTFIX.length();
+            return fullname.substring( 0, end );
+        }
+        else if( isMap() )
+        {
+            final int end = fullname.length() - MAP_POSTFIX.length();
+            return fullname.substring( 0, end );
+        }
+        else
+        {
+            return fullname;
+        }
     }
 
     /**
Index: info/src/java/org/apache/avalon/framework/info/EntryDescriptor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/EntryDescriptor.java,v
retrieving revision 1.7
diff -u -r1.7 EntryDescriptor.java
--- info/src/java/org/apache/avalon/framework/info/EntryDescriptor.java 29 Sep 
2002 04:13:47 -0000      1.7
+++ info/src/java/org/apache/avalon/framework/info/EntryDescriptor.java 28 Nov 
2002 08:10:18 -0000
@@ -35,6 +35,11 @@
     implements Serializable
 {
     /**
+     * Emprty set of entrys.
+     */
+    public static final EntryDescriptor[] EMPTY_SET = new EntryDescriptor[ 0 ];
+
+    /**
      * The name the component uses to lookup entry.
      */
     private final String m_key;
@@ -58,7 +63,6 @@
                             final Attribute[] attribute )
     {
         super( attribute );
-
         if( null == key )
         {
             throw new NullPointerException( "key" );
Index: info/src/java/org/apache/avalon/framework/info/LoggerDescriptor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/LoggerDescriptor.java,v
retrieving revision 1.6
diff -u -r1.6 LoggerDescriptor.java
--- info/src/java/org/apache/avalon/framework/info/LoggerDescriptor.java        
29 Sep 2002 04:13:47 -0000      1.6
+++ info/src/java/org/apache/avalon/framework/info/LoggerDescriptor.java        
28 Nov 2002 08:10:18 -0000
@@ -23,6 +23,14 @@
 public class LoggerDescriptor
     extends FeatureDescriptor
 {
+    /**
+     * A empty array of logger descriptors
+     */
+    public static final LoggerDescriptor[] EMPTY_SET = new LoggerDescriptor[ 0 
];
+
+    /**
+     * The name of the logger. 
+     */
     private final String m_name;
 
     /**
Index: info/src/java/org/apache/avalon/framework/info/ServiceDescriptor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ServiceDescriptor.java,v
retrieving revision 1.8
diff -u -r1.8 ServiceDescriptor.java
--- info/src/java/org/apache/avalon/framework/info/ServiceDescriptor.java       
4 Oct 2002 05:53:00 -0000       1.8
+++ info/src/java/org/apache/avalon/framework/info/ServiceDescriptor.java       
28 Nov 2002 08:10:19 -0000
@@ -30,29 +30,34 @@
     extends FeatureDescriptor
 {
     /**
+     * Constant set of 0 service descriptors.
+     */
+    public static final ServiceDescriptor[] EMPTY_SET = new ServiceDescriptor[ 
0 ];
+
+    /**
      * The implementationKey for the service.
      * This usually indicates the name of the service
      * class.
      */
-    private final String m_implementationKey;
+    private final String m_type;
 
     /**
      * Construct a service with specified name and Attributes.
      *
-     * @param implementationKey the implementationKey of Service
+     * @param type the type of Service
      * @param attributes the attributes of service
      */
-    public ServiceDescriptor( final String implementationKey,
+    public ServiceDescriptor( final String type,
                               final Attribute[] attributes )
     {
         super( attributes );
 
-        if( null == implementationKey )
+        if( null == type )
         {
-            throw new NullPointerException( "implementationKey" );
+            throw new NullPointerException( "type" );
         }
 
-        m_implementationKey = implementationKey;
+        m_type = type;
     }
 
     /**
@@ -60,9 +65,9 @@
      *
      * @return the implementationKey of service.
      */
-    public String getImplementationKey()
+    public String getType()
     {
-        return m_implementationKey;
+        return m_type;
     }
 
     /**
@@ -73,7 +78,7 @@
     public String toString()
     {
         final StringBuffer sb = new StringBuffer();
-        sb.append( m_implementationKey );
+        sb.append( m_type );
         sb.append( attributesToString() );
         return sb.toString();
     }
Index: info/src/java/org/apache/avalon/framework/tools/ant/FormatEnum.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/ant/FormatEnum.java,v
retrieving revision 1.2
diff -u -r1.2 FormatEnum.java
--- info/src/java/org/apache/avalon/framework/tools/ant/FormatEnum.java 12 Nov 
2002 07:12:16 -0000      1.2
+++ info/src/java/org/apache/avalon/framework/tools/ant/FormatEnum.java 28 Nov 
2002 08:10:19 -0000
@@ -19,8 +19,25 @@
 public class FormatEnum
     extends EnumeratedAttribute
 {
+    public int getTypeCode()
+    {
+        final String value = super.getValue();
+        if( value.equals( "legacy") )
+        {
+            return MetaGenerateTask.LEGACY_TYPE;
+        }
+        else if( value.equals( "ser" ) )
+        {
+            return MetaGenerateTask.SER_TYPE;
+        }
+        else
+        {
+            return MetaGenerateTask.XML_TYPE;
+        }
+    }
+
     public String[] getValues()
     {
-        return new String[]{"xml", "ser"};
+        return new String[]{"xml", "ser", "legacy"};
     }
 }
Index: info/src/java/org/apache/avalon/framework/tools/ant/MetaGenerateTask.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/ant/MetaGenerateTask.java,v
retrieving revision 1.8
diff -u -r1.8 MetaGenerateTask.java
--- info/src/java/org/apache/avalon/framework/tools/ant/MetaGenerateTask.java   
16 Nov 2002 08:01:04 -0000      1.8
+++ info/src/java/org/apache/avalon/framework/tools/ant/MetaGenerateTask.java   
28 Nov 2002 08:10:19 -0000
@@ -18,6 +18,7 @@
 import org.apache.avalon.framework.tools.infobuilder.SerializedInfoWriter;
 import org.apache.avalon.framework.tools.infobuilder.InfoWriter;
 import org.apache.avalon.framework.tools.infobuilder.XMLInfoWriter;
+import org.apache.avalon.framework.tools.infobuilder.LegacyBlockInfoWriter;
 import org.apache.avalon.framework.tools.qdox.DefaultInfoBuilder;
 import org.apache.avalon.framework.tools.qdox.LegacyInfoBuilder;
 import org.apache.avalon.framework.tools.ant.FormatEnum;
@@ -31,9 +32,16 @@
  * @author <a href="mailto:peter at apache.org">Peter Donald</a>
  * @version $Revision: 1.8 $ $Date: 2002/11/16 08:01:04 $
  */
-public final class MetaGenerateTask
+public class MetaGenerateTask
     extends AbstractQdoxTask
 {
+    /*
+    * A set of type codes for format.
+    */
+    public static final int XML_TYPE = 0;
+    public static final int SER_TYPE = 1;
+    public static final int LEGACY_TYPE = 2;
+
     /**
      * A utility object that writes out info as xml files.
      */
@@ -45,16 +53,19 @@
     private static final InfoWriter c_serWriter = new SerializedInfoWriter();
 
     /**
+     * A utility object that writes out info as serialized object files.
+     */
+    private static final InfoWriter c_legacyWriter = new 
LegacyBlockInfoWriter();
+
+    /**
      * The destination directory for metadata files.
      */
     private File m_destDir;
 
     /**
-     * Variable that indicates whether the output
-     * should be done as xml (if true) or as serialized
-     * objests (if false).
+     * Variable that indicates the output type.
      */
-    private boolean m_xmlOutput = true;
+    private int m_format;
 
     /**
      * Variable that indicates whether the output
@@ -80,7 +91,7 @@
      */
     public void setFormat( final FormatEnum format )
     {
-        m_xmlOutput = "xml".equals( format.getValue() );
+        m_format = format.getTypeCode();
     }
 
     /**
@@ -151,14 +162,18 @@
      */
     private String getOutputDescription()
     {
-        if( m_xmlOutput )
+        if( XML_TYPE == m_format )
         {
             return "xml";
         }
-        else
+        else if( SER_TYPE == m_format )
         {
             return "serialized objects";
         }
+        else
+        {
+            return "legacy xml";
+        }
     }
 
     /**
@@ -253,14 +268,18 @@
      */
     private InfoWriter getInfoWriter()
     {
-        if( m_xmlOutput )
+        if( XML_TYPE == m_format )
         {
             return c_xmlWriter;
         }
-        else
+        else if( SER_TYPE == m_format  )
         {
             return c_serWriter;
         }
+        else
+        {
+            return c_legacyWriter;
+        }
     }
 
     /**
@@ -274,14 +293,18 @@
         throws IOException
     {
         String filename =
-            classname.replace( '.', File.separatorChar ) + "-info";
-        if( m_xmlOutput )
+            classname.replace( '.', File.separatorChar );
+        if( XML_TYPE == m_format )
+        {
+            filename += "-info.xml";
+        }
+        else if( SER_TYPE == m_format )
         {
-            filename += ".xml";
+            filename += "-info.ser";
         }
         else
         {
-            filename += ".ser";
+            filename += ".xinfo";
         }
         return new File( m_destDir, filename ).getCanonicalFile();
     }
@@ -305,4 +328,13 @@
         }
     }
 
+    /**
+     * Return the destination directory in which files are generated.
+     *
+     * @return the destination directory in which files are generated.
+     */
+    protected final File getDestDir()
+    {
+        return m_destDir;
+    }
 }
Index: 
info/src/java/org/apache/avalon/framework/tools/infobuilder/InfoBuilder.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/InfoBuilder.java,v
retrieving revision 1.4
diff -u -r1.4 InfoBuilder.java
--- 
info/src/java/org/apache/avalon/framework/tools/infobuilder/InfoBuilder.java    
    14 Nov 2002 07:44:30 -0000      1.4
+++ 
info/src/java/org/apache/avalon/framework/tools/infobuilder/InfoBuilder.java    
    28 Nov 2002 08:10:20 -0000
@@ -48,6 +48,10 @@
         {
             setupLogger( m_legacyInfoCreator );
         }
+        if( null != m_legacyInfoCreator )
+        {
+            setupLogger( m_legacyInfoCreator );
+        }
     }
 
     /**
Index: 
info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoReader.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoReader.java,v
retrieving revision 1.6
diff -u -r1.6 LegacyBlockInfoReader.java
--- 
info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoReader.java
      24 Nov 2002 12:15:26 -0000      1.6
+++ 
info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoReader.java
      28 Nov 2002 08:10:21 -0000
@@ -9,7 +9,6 @@
 
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Properties;
 import org.apache.avalon.excalibur.i18n.ResourceManager;
 import org.apache.avalon.excalibur.i18n.Resources;
 import org.apache.avalon.framework.configuration.Configuration;
@@ -17,12 +16,10 @@
 import org.apache.avalon.framework.info.Attribute;
 import org.apache.avalon.framework.info.ComponentDescriptor;
 import org.apache.avalon.framework.info.ComponentInfo;
-import org.apache.avalon.framework.info.ContextDescriptor;
 import org.apache.avalon.framework.info.DependencyDescriptor;
-import org.apache.avalon.framework.info.EntryDescriptor;
 import org.apache.avalon.framework.info.LoggerDescriptor;
-import org.apache.avalon.framework.info.ServiceDescriptor;
 import org.apache.avalon.framework.info.SchemaDescriptor;
+import org.apache.avalon.framework.info.ServiceDescriptor;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.xml.sax.InputSource;
 
@@ -119,8 +116,8 @@
 
         return new ComponentInfo( descriptor,
                                   services,
-                                  new LoggerDescriptor[ 0 ],
-                                  buildPhoenixContext(),
+                                  LoggerDescriptor.EMPTY_SET,
+                                  LegacyUtil.CONTEXT_DESCRIPTOR,
                                   dependencies, schema, null );
     }
 
@@ -139,27 +136,14 @@
         }
         else
         {
-            //TODO: Map phoenix type to uri space when figured out
-            return new SchemaDescriptor( "",
-                                         schemaType, new Attribute[ 0 ] );
+            final String schemaUri =
+                LegacyUtil.translateToSchemaUri( schemaType );
+            return new SchemaDescriptor( "", schemaUri, Attribute.EMPTY_SET );
         }
 
     }
 
     /**
-     * A utility method to build a descriptor for Phoenixs BlockContext
-     * object,
-     *
-     * @return the a descriptor for Phoenixs BlockContext object,
-     */
-    private ContextDescriptor buildPhoenixContext()
-    {
-        return new ContextDescriptor( "org.apache.avalon.phoenix.BlockContext",
-                                      new EntryDescriptor[ 0 ],
-                                      new Attribute[ 0 ] );
-    }
-
-    /**
      * A utility method to build an array of [EMAIL PROTECTED] 
DependencyDescriptor}
      * objects from specified configuration and classname.
      *
@@ -182,7 +166,7 @@
             dependencies.add( dependency );
         }
 
-        return (DependencyDescriptor[])dependencies.toArray( new 
DependencyDescriptor[ 0 ] );
+        return (DependencyDescriptor[])dependencies.toArray( 
DependencyDescriptor.EMPTY_SET );
     }
 
     /**
@@ -224,7 +208,7 @@
         return new DependencyDescriptor( key,
                                          implementationKey,
                                          false,
-                                         new Attribute[ 0 ] );
+                                         Attribute.EMPTY_SET );
     }
 
     /**
@@ -253,7 +237,7 @@
             services.add( service );
         }
 
-        return (ServiceDescriptor[])services.toArray( new ServiceDescriptor[ 0 
] );
+        return (ServiceDescriptor[])services.toArray( 
ServiceDescriptor.EMPTY_SET );
     }
 
     /**
@@ -274,16 +258,12 @@
         final ArrayList attributeSet = new ArrayList();
         if( null != version )
         {
-            final Attribute attribute =
-                createSimpleAttribute( "avalon", "version", version );
-            attributeSet.add( attribute );
+            attributeSet.add( LegacyUtil.createVersionAttribute( version ) );
         }
 
         if( isManagement )
         {
-            final Attribute mxAttribute =
-                createSimpleAttribute( "phoenix", "mx", "true" );
-            attributeSet.add( mxAttribute );
+            attributeSet.add( LegacyUtil.MX_ATTRIBUTE );
         }
 
         final Attribute[] attributes = (Attribute[])attributeSet.toArray( new 
Attribute[ attributeSet.size() ] );
@@ -304,27 +284,9 @@
     {
         final String version = config.getChild( "version" ).getValue();
         final ArrayList attributeSet = new ArrayList();
-        final Attribute attribute = createSimpleAttribute( "avalon", 
"version", version );
-        attributeSet.add( attribute );
+        attributeSet.add( LegacyUtil.createVersionAttribute( version ) );
 
         final Attribute[] attributes = (Attribute[])attributeSet.toArray( new 
Attribute[ attributeSet.size() ] );
         return new ComponentDescriptor( classname, attributes );
-    }
-
-    /**
-     * Helper method to create simple attributes with one parameter.
-     *
-     * @param name the name of the parameter
-     * @param value the value of the parameter
-     * @param attributeName the name of the attribute
-     * @return
-     */
-    private Attribute createSimpleAttribute( final String attributeName,
-                                             final String name,
-                                             final String value )
-    {
-        final Properties parameters = new Properties();
-        parameters.setProperty( name, value );
-        return new Attribute( attributeName, parameters );
     }
 }
Index: 
info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoReader.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoReader.java,v
retrieving revision 1.5
diff -u -r1.5 XMLInfoReader.java
--- 
info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoReader.java  
    24 Nov 2002 12:15:26 -0000      1.5
+++ 
info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoReader.java  
    28 Nov 2002 08:10:22 -0000
@@ -114,7 +114,7 @@
 
         configuration = info.getChild( "parameters-schema", false );
         final SchemaDescriptor parametersSchema = buildSchema( configuration );
-        
+
         if( getLogger().isDebugEnabled() )
         {
             final String message =
@@ -215,7 +215,7 @@
             dependencies.add( dependency );
         }
 
-        return (DependencyDescriptor[])dependencies.toArray( new 
DependencyDescriptor[ 0 ] );
+        return (DependencyDescriptor[])dependencies.toArray( 
DependencyDescriptor.EMPTY_SET );
     }
 
     /**
@@ -280,7 +280,7 @@
 
         final String type =
             context.getAttribute( "type",
-                                  Context.class.getName() );
+                                  ContextDescriptor.DEFAULT_TYPE );
 
         return new ContextDescriptor( type, entrys, attributes );
     }
@@ -346,7 +346,7 @@
             services.add( service );
         }
 
-        return (ServiceDescriptor[])services.toArray( new ServiceDescriptor[ 0 
] );
+        return (ServiceDescriptor[])services.toArray( 
ServiceDescriptor.EMPTY_SET );
     }
 
     /**
@@ -360,9 +360,9 @@
     private ServiceDescriptor buildService( final Configuration service )
         throws ConfigurationException
     {
-        final String implementationKey = service.getAttribute( "type" );
+        final String type = service.getAttribute( "type" );
         final Attribute[] attributes = buildAttributes( service );
-        return new ServiceDescriptor( implementationKey, attributes );
+        return new ServiceDescriptor( type, attributes );
     }
 
     /**
@@ -399,7 +399,14 @@
     {
         final String name = config.getAttribute( "name" );
         final Properties parameters = buildParameters( config );
-        return new Attribute( name, parameters );
+        if( 0 == parameters.size() )
+        {
+            return new Attribute( name, null );
+        }
+        else
+        {
+            return new Attribute( name, parameters );
+        }
     }
 
     /**
Index: 
info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoWriter.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoWriter.java,v
retrieving revision 1.8
diff -u -r1.8 XMLInfoWriter.java
--- 
info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoWriter.java  
    24 Nov 2002 12:15:26 -0000      1.8
+++ 
info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoWriter.java  
    28 Nov 2002 08:10:23 -0000
@@ -294,7 +294,7 @@
         {
             final ServiceDescriptor service = services[ i ];
             writer.write( "<service type=\"" );
-            writer.write( service.getImplementationKey() );
+            writer.write( service.getType() );
             final Attribute[] attributes = service.getAttributes();
             if( 0 == attributes.length )
             {
Index: 
info/src/java/org/apache/avalon/framework/tools/qdox/AbstractInfoBuilder.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/qdox/AbstractInfoBuilder.java,v
retrieving revision 1.1
diff -u -r1.1 AbstractInfoBuilder.java
--- 
info/src/java/org/apache/avalon/framework/tools/qdox/AbstractInfoBuilder.java   
    16 Nov 2002 05:14:07 -0000      1.1
+++ 
info/src/java/org/apache/avalon/framework/tools/qdox/AbstractInfoBuilder.java   
    28 Nov 2002 08:10:23 -0000
@@ -7,11 +7,11 @@
  */
 package org.apache.avalon.framework.tools.qdox;
 
+import com.thoughtworks.qdox.model.DocletTag;
 import com.thoughtworks.qdox.model.JavaClass;
 import com.thoughtworks.qdox.model.JavaMethod;
 import com.thoughtworks.qdox.model.Type;
-import com.thoughtworks.qdox.model.DocletTag;
-import org.apache.avalon.framework.info.Attribute;
+import org.apache.avalon.framework.info.ContextDescriptor;
 
 /**
  * This is an abstract base class that is used to build a ComponentInfo object
@@ -25,8 +25,7 @@
 {
     protected static final String LOGGER_CLASS =
         "org.apache.avalon.framework.logger.Logger";
-    protected static final String CONTEXT_CLASS =
-        "org.apache.avalon.framework.context.Context";
+    protected static final String CONTEXT_CLASS = 
ContextDescriptor.DEFAULT_TYPE;
     protected static final String COMPONENT_MANAGER_CLASS =
         "org.apache.avalon.framework.component.ComponentManager";
     protected static final String SERVICE_MANAGER_CLASS =
@@ -35,7 +34,6 @@
         "org.apache.avalon.framework.configuration.Configuration";
     protected static final String PARAMETERS_CLASS =
         "org.apache.avalon.framework.parameters.Parameters";
-    protected static final Attribute[] EMPTY_ATTRIBUTES = new Attribute[ 0 ];
 
     /**
      * Resolve the specified type.
Index: 
info/src/java/org/apache/avalon/framework/tools/qdox/DefaultInfoBuilder.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/qdox/DefaultInfoBuilder.java,v
retrieving revision 1.3
diff -u -r1.3 DefaultInfoBuilder.java
--- 
info/src/java/org/apache/avalon/framework/tools/qdox/DefaultInfoBuilder.java    
    24 Nov 2002 12:15:26 -0000      1.3
+++ 
info/src/java/org/apache/avalon/framework/tools/qdox/DefaultInfoBuilder.java    
    28 Nov 2002 08:10:24 -0000
@@ -19,6 +19,7 @@
 import org.apache.avalon.framework.info.LoggerDescriptor;
 import org.apache.avalon.framework.info.SchemaDescriptor;
 import org.apache.avalon.framework.info.ServiceDescriptor;
+import org.apache.avalon.framework.info.Attribute;
 
 /**
  * This is a utility class that is used to build a ComponentInfo object
@@ -63,7 +64,7 @@
     private ComponentDescriptor buildComponent( final JavaClass javaClass )
     {
         final String type = javaClass.getFullyQualifiedName();
-        return new ComponentDescriptor( type, EMPTY_ATTRIBUTES );
+        return new ComponentDescriptor( type, Attribute.EMPTY_SET );
     }
 
     /**
@@ -81,7 +82,7 @@
             final DocletTag tag = tags[ i ];
             final String unresolvedType = getNamedParameter( tag, "type" );
             final String type = resolveType( javaClass, unresolvedType );
-            final ServiceDescriptor service = new ServiceDescriptor( type, 
EMPTY_ATTRIBUTES );
+            final ServiceDescriptor service = new ServiceDescriptor( type, 
Attribute.EMPTY_SET );
             services.add( service );
         }
         return (ServiceDescriptor[])services.toArray( new ServiceDescriptor[ 
services.size() ] );
@@ -99,7 +100,7 @@
             getLifecycleMethod( javaClass, "enableLogging", LOGGER_CLASS );
         if( null == method )
         {
-            return new LoggerDescriptor[ 0 ];
+            return LoggerDescriptor.EMPTY_SET;
         }
         else
         {
@@ -110,7 +111,7 @@
                 final String name =
                     getNamedParameter( tags[ i ], "name", "" );
                 final LoggerDescriptor logger =
-                    new LoggerDescriptor( name, EMPTY_ATTRIBUTES );
+                    new LoggerDescriptor( name, Attribute.EMPTY_SET );
                 loggers.add( logger );
             }
             return (LoggerDescriptor[])loggers.toArray( new LoggerDescriptor[ 
loggers.size() ] );
@@ -129,9 +130,7 @@
             getLifecycleMethod( javaClass, "contextualize", CONTEXT_CLASS );
         if( null == method )
         {
-            return new ContextDescriptor( CONTEXT_CLASS,
-                                          new EntryDescriptor[ 0 ],
-                                          EMPTY_ATTRIBUTES );
+            return ContextDescriptor.EMPTY_CONTEXT;
         }
         else
         {
@@ -152,13 +151,13 @@
                 final String optional = getNamedParameter( tags[ i ], 
"optional", "false" );
                 final boolean isOptional = "true".equals( optional );
                 final EntryDescriptor entry =
-                    new EntryDescriptor( key, entryType, isOptional, 
EMPTY_ATTRIBUTES );
+                    new EntryDescriptor( key, entryType, isOptional, 
Attribute.EMPTY_SET );
                 entrySet.add( entry );
             }
             final EntryDescriptor[] entrys =
                 (EntryDescriptor[])entrySet.toArray( new EntryDescriptor[ 
entrySet.size() ] );
 
-            return new ContextDescriptor( type, entrys, EMPTY_ATTRIBUTES );
+            return new ContextDescriptor( type, entrys, Attribute.EMPTY_SET );
         }
     }
 
@@ -187,7 +186,7 @@
             final String location = getNamedParameter( tag, "location", "" );
             final String type = getNamedParameter( tag, "type", "" );
 
-            return new SchemaDescriptor( location, type, EMPTY_ATTRIBUTES );
+            return new SchemaDescriptor( location, type, Attribute.EMPTY_SET );
         }
     }
 
@@ -216,7 +215,7 @@
             final String location = getNamedParameter( tag, "location", "" );
             final String type = getNamedParameter( tag, "type", "" );
 
-            return new SchemaDescriptor( location, type, EMPTY_ATTRIBUTES );
+            return new SchemaDescriptor( location, type, Attribute.EMPTY_SET );
         }
     }
 
@@ -240,7 +239,7 @@
 
         if( null == method )
         {
-            return new DependencyDescriptor[ 0 ];
+            return DependencyDescriptor.EMPTY_SET;
         }
         else
         {
@@ -255,7 +254,7 @@
                 final String optional = getNamedParameter( tag, "optional", 
"false" );
                 final boolean isOptional = "true".equals( optional );
                 final DependencyDescriptor dependency =
-                    new DependencyDescriptor( key, type, isOptional, 
EMPTY_ATTRIBUTES );
+                    new DependencyDescriptor( key, type, isOptional, 
Attribute.EMPTY_SET );
                 deps.add( dependency );
             }
             return (DependencyDescriptor[])deps.toArray( new 
DependencyDescriptor[ deps.size() ] );
Index: 
info/src/java/org/apache/avalon/framework/tools/qdox/LegacyInfoBuilder.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/qdox/LegacyInfoBuilder.java,v
retrieving revision 1.2
diff -u -r1.2 LegacyInfoBuilder.java
--- info/src/java/org/apache/avalon/framework/tools/qdox/LegacyInfoBuilder.java 
24 Nov 2002 12:15:26 -0000      1.2
+++ info/src/java/org/apache/avalon/framework/tools/qdox/LegacyInfoBuilder.java 
28 Nov 2002 08:10:24 -0000
@@ -16,10 +16,10 @@
 import org.apache.avalon.framework.info.ComponentInfo;
 import org.apache.avalon.framework.info.ContextDescriptor;
 import org.apache.avalon.framework.info.DependencyDescriptor;
-import org.apache.avalon.framework.info.EntryDescriptor;
 import org.apache.avalon.framework.info.LoggerDescriptor;
 import org.apache.avalon.framework.info.SchemaDescriptor;
 import org.apache.avalon.framework.info.ServiceDescriptor;
+import org.apache.avalon.framework.tools.infobuilder.LegacyUtil;
 
 /**
  * Build a ComponentInfo object by interpreting Phoenix style javadoc
@@ -42,25 +42,13 @@
     {
         final ComponentDescriptor component = buildComponent( javaClass );
         final ServiceDescriptor[] services = buildServices( javaClass );
-        final ContextDescriptor context = buildPhoenixContext();
-        final LoggerDescriptor[] loggers = new LoggerDescriptor[ 0 ];
+        final ContextDescriptor context = LegacyUtil.CONTEXT_DESCRIPTOR;
+        final LoggerDescriptor[] loggers = LoggerDescriptor.EMPTY_SET;
         final SchemaDescriptor schema = buildConfigurationSchema( javaClass );
         final DependencyDescriptor[] dependencies = buildDependencies( 
javaClass );
 
-        return new ComponentInfo( component, services, loggers, context, 
dependencies, schema, null );
-    }
-
-    /**
-     * A utility method to build a descriptor for Phoenixs BlockContext
-     * object,
-     *
-     * @return the a descriptor for Phoenixs BlockContext object,
-     */
-    private ContextDescriptor buildPhoenixContext()
-    {
-        return new ContextDescriptor( "org.apache.avalon.phoenix.BlockContext",
-                                      new EntryDescriptor[ 0 ],
-                                      new Attribute[ 0 ] );
+        return new ComponentInfo( component, services, loggers, context,
+                                  dependencies, schema, null );
     }
 
     /**
@@ -72,7 +60,7 @@
     private ComponentDescriptor buildComponent( final JavaClass javaClass )
     {
         final String type = javaClass.getFullyQualifiedName();
-        return new ComponentDescriptor( type, EMPTY_ATTRIBUTES );
+        return new ComponentDescriptor( type, Attribute.EMPTY_SET );
     }
 
     /**
@@ -88,7 +76,7 @@
         for( int i = 0; i < tags.length; i++ )
         {
             final String type = getNamedParameter( tags[ i ], "name" );
-            final ServiceDescriptor service = new ServiceDescriptor( type, 
EMPTY_ATTRIBUTES );
+            final ServiceDescriptor service = new ServiceDescriptor( type, 
Attribute.EMPTY_SET );
             services.add( service );
         }
         return (ServiceDescriptor[])services.toArray( new ServiceDescriptor[ 
services.size() ] );
@@ -116,9 +104,8 @@
             return null;
         }
         final String type = getNamedParameter( tag, "type", "" );
-        //TODO: Translate type into a uri type string
-        return new SchemaDescriptor(
-            "", type, EMPTY_ATTRIBUTES );
+        final String schemaUri = LegacyUtil.translateToSchemaUri( type );
+        return new SchemaDescriptor( "", schemaUri, Attribute.EMPTY_SET );
     }
 
     /**
@@ -141,7 +128,7 @@
 
         if( null == method )
         {
-            return new DependencyDescriptor[ 0 ];
+            return DependencyDescriptor.EMPTY_SET;
         }
         else
         {
@@ -154,7 +141,7 @@
                 final String type = resolveType( javaClass, unresolvedType );
                 final String key = getNamedParameter( tag, "role", type );
                 final DependencyDescriptor dependency =
-                    new DependencyDescriptor( key, type, false, 
EMPTY_ATTRIBUTES );
+                    new DependencyDescriptor( key, type, false, 
Attribute.EMPTY_SET );
                 deps.add( dependency );
             }
             return (DependencyDescriptor[])deps.toArray( new 
DependencyDescriptor[ deps.size() ] );
Index: 
info/src/java/org/apache/avalon/framework/tools/verifier/InfoVerifier.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/verifier/InfoVerifier.java,v
retrieving revision 1.5
diff -u -r1.5 InfoVerifier.java
--- info/src/java/org/apache/avalon/framework/tools/verifier/InfoVerifier.java  
24 Nov 2002 12:15:26 -0000      1.5
+++ info/src/java/org/apache/avalon/framework/tools/verifier/InfoVerifier.java  
28 Nov 2002 08:10:25 -0000
@@ -279,7 +279,7 @@
         final Class[] classes = new Class[ services.length ];
         for( int i = 0; i < services.length; i++ )
         {
-            final String classname = services[ i ].getImplementationKey();
+            final String classname = services[ i ].getType();
             try
             {
                 classes[ i ] = classLoader.loadClass( classname );
Index: 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoAssert.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoAssert.java,v
retrieving revision 1.7
diff -u -r1.7 InfoAssert.java
--- 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoAssert.java
    24 Nov 2002 12:15:26 -0000      1.7
+++ 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoAssert.java
    28 Nov 2002 08:10:26 -0000
@@ -26,8 +26,6 @@
  */
 public class InfoAssert
 {
-    public static final Attribute[] EMPTY_ATTRIBUTES = new Attribute[ 0 ];
-
     public static void assertEqualStructure( final String message,
                                              final ComponentInfo expected,
                                              final ComponentInfo actual )
@@ -148,8 +146,8 @@
                                             final ServiceDescriptor actual )
     {
         Assert.assertEquals( message + ".type",
-                             expected.getImplementationKey(),
-                             actual.getImplementationKey() );
+                             expected.getType(),
+                             actual.getType() );
         assertEqualAttributes( message + ".attributes",
                                expected.getAttributes(),
                                actual.getAttributes() );
Index: 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoBuilderTestCase.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoBuilderTestCase.java,v
retrieving revision 1.17
diff -u -r1.17 InfoBuilderTestCase.java
--- 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoBuilderTestCase.java
   24 Nov 2002 12:15:26 -0000      1.17
+++ 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/InfoBuilderTestCase.java
   28 Nov 2002 08:10:27 -0000
@@ -36,6 +36,8 @@
 import org.apache.avalon.framework.tools.infobuilder.SerializedInfoWriter;
 import org.apache.avalon.framework.tools.infobuilder.XMLInfoReader;
 import org.apache.avalon.framework.tools.infobuilder.XMLInfoWriter;
+import org.apache.avalon.framework.tools.infobuilder.LegacyBlockInfoReader;
+import org.apache.avalon.framework.tools.infobuilder.LegacyBlockInfoWriter;
 import org.apache.avalon.framework.tools.qdox.DefaultInfoBuilder;
 import org.apache.avalon.framework.tools.qdox.LegacyInfoBuilder;
 
@@ -105,23 +107,18 @@
     private ComponentInfo createComponentInfoWithParameters()
     {
         final ComponentDescriptor component =
-            new ComponentDescriptor( "org.realityforge.Component1", 
InfoAssert.EMPTY_ATTRIBUTES );
-
-        final ContextDescriptor context =
-            new ContextDescriptor( 
"org.apache.avalon.framework.context.Context",
-                                   new EntryDescriptor[ 0 ],
-                                   InfoAssert.EMPTY_ATTRIBUTES );
+            new ComponentDescriptor( "org.realityforge.Component1", 
Attribute.EMPTY_SET );
 
         final SchemaDescriptor schema =
             new SchemaDescriptor( "",
                                   "",
-                                  InfoAssert.EMPTY_ATTRIBUTES );
+                                  Attribute.EMPTY_SET );
 
         return new ComponentInfo( component,
-                                  new ServiceDescriptor[0],
-                                  new LoggerDescriptor[ 0 ],
-                                  context,
-                                  new DependencyDescriptor[0],
+                                  ServiceDescriptor.EMPTY_SET,
+                                  LoggerDescriptor.EMPTY_SET,
+                                  ContextDescriptor.EMPTY_CONTEXT,
+                                  DependencyDescriptor.EMPTY_SET,
                                   null,
                                   schema );
     }
@@ -142,6 +139,15 @@
                           new XMLInfoReader() );
     }
 
+    public void testWriteLegacyXMLComponent1()
+        throws Exception
+    {
+        final ComponentInfo info = loadComponentInfo( COMPONENT2 );
+        runWriteReadTest( info,
+                          new LegacyBlockInfoWriter(),
+                          new LegacyBlockInfoReader() );
+    }
+
     public void testQDoxScan()
         throws Exception
     {
@@ -200,8 +206,8 @@
         final FileInputStream inputStream = new FileInputStream( output );
         final ComponentInfo actual = reader.createComponentInfo( 
implementationKey, inputStream );
         inputStream.close();
-        output.deleteOnExit();
-        output.delete();
+        //output.deleteOnExit();
+        //output.delete();
 
         InfoAssert.assertEqualInfos( " Dummy ComponentInfo written out and 
read back " +
                                      "in again should be equal",
@@ -212,22 +218,22 @@
     private ComponentInfo createDummyComponentInfo()
     {
         final ComponentDescriptor component =
-            new ComponentDescriptor( "org.realityforge.Component1", 
InfoAssert.EMPTY_ATTRIBUTES );
+            new ComponentDescriptor( "org.realityforge.Component1", 
Attribute.EMPTY_SET );
 
-        final LoggerDescriptor logger1 = new LoggerDescriptor( "", 
InfoAssert.EMPTY_ATTRIBUTES );
-        final LoggerDescriptor logger2 = new LoggerDescriptor( "audit", 
InfoAssert.EMPTY_ATTRIBUTES );
+        final LoggerDescriptor logger1 = new LoggerDescriptor( "", 
Attribute.EMPTY_SET );
+        final LoggerDescriptor logger2 = new LoggerDescriptor( "audit", 
Attribute.EMPTY_SET );
         final LoggerDescriptor[] loggers = new LoggerDescriptor[]{logger1, 
logger2};
 
         final EntryDescriptor entry1 = new EntryDescriptor( "mbean",
                                                             
"javax.jmx.MBeanServer",
                                                             false,
-                                                            
InfoAssert.EMPTY_ATTRIBUTES );
+                                                            
Attribute.EMPTY_SET );
 
         final EntryDescriptor[] entrys = new EntryDescriptor[]{entry1};
         final ContextDescriptor context =
             new ContextDescriptor( "org.apache.avalon.phoenix.BlockContext",
                                    entrys,
-                                   InfoAssert.EMPTY_ATTRIBUTES );
+                                   Attribute.EMPTY_SET );
 
         final ServiceDescriptor service1 = createServiceDescriptor();
 
@@ -236,19 +242,19 @@
             new DependencyDescriptor( "org.realityforge.Service2",
                                       "org.realityforge.Service2",
                                       true,
-                                      InfoAssert.EMPTY_ATTRIBUTES );
+                                      Attribute.EMPTY_SET );
         final DependencyDescriptor dependency2 =
             new DependencyDescriptor( "foo",
                                       "org.realityforge.Service3",
                                       false,
-                                      InfoAssert.EMPTY_ATTRIBUTES );
+                                      Attribute.EMPTY_SET );
         final DependencyDescriptor[] deps =
             new DependencyDescriptor[]{dependency1, dependency2};
 
         final SchemaDescriptor schema =
             new SchemaDescriptor( "",
                                   "http://relaxng.org/ns/structure/1.0";,
-                                  InfoAssert.EMPTY_ATTRIBUTES );
+                                  Attribute.EMPTY_SET );
 
         return new ComponentInfo( component, services, loggers,
                                   context, deps, schema, null );
Index: 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1-info.xml
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1-info.xml,v
retrieving revision 1.2
diff -u -r1.2 QDoxLegacyComponent1-info.xml
--- 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1-info.xml
 24 Nov 2002 12:15:27 -0000      1.2
+++ 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1-info.xml
 28 Nov 2002 08:10:27 -0000
@@ -20,6 +20,6 @@
         <dependency 
type="org.apache.avalon.framework.tools.infobuilder.test.data.otherpkg.Service2"/>
     </dependencies>
 
-    <configuration-schema type="rlng"/>
+    <configuration-schema type="http://relaxng.org/ns/structure/1.0"/>
 
 </component-info>
Index: 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1.java,v
retrieving revision 1.2
diff -u -r1.2 QDoxLegacyComponent1.java
--- 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1.java
     16 Nov 2002 07:59:00 -0000      1.2
+++ 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/QDoxLegacyComponent1.java
     28 Nov 2002 08:10:27 -0000
@@ -43,7 +43,7 @@
     }
 
     /**
-     * @phoenix:configuration-schema type="rlng"
+     * @phoenix:configuration-schema type="relax-ng"
      */
     public void configure( Configuration configuration )
         throws ConfigurationException
Index: 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component2.xinfo
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component2.xinfo,v
retrieving revision 1.1
diff -u -r1.1 component2.xinfo
--- 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component2.xinfo
      4 Oct 2002 06:10:35 -0000       1.1
+++ 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component2.xinfo
      28 Nov 2002 08:10:27 -0000
@@ -7,7 +7,7 @@
   <!-- section to describe block -->
   <block>
     <version>1.0</version>
-      <schema-type>rlng</schema-type>
+      <schema-type>relax-ng</schema-type>
   </block>
 
   <!-- services that are offered by this block -->
Index: 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component3-info.xml
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component3-info.xml,v
retrieving revision 1.3
diff -u -r1.3 component3-info.xml
--- 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component3-info.xml
   24 Nov 2002 12:15:27 -0000      1.3
+++ 
info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component3-info.xml
   28 Nov 2002 08:10:27 -0000
@@ -7,7 +7,7 @@
 
     <!-- This component should be identical to the one loaded out of 
component2 blockinfo -->
     <component 
type="org.apache.avalon.framework.tools.infobuilder.test.data.component3">
-        <attribute name="avalon">
+        <attribute name="phoenix:version">
             <param name="version" value="1.0"/>
         </attribute>
     </component>
@@ -17,9 +17,7 @@
     <services>
         <service 
type="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"/>
         <service 
type="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler2">
-            <attribute name="phoenix">
-                <param name="mx" value="true"/>
-            </attribute>
+            <attribute name="phoenix:mx"/>
         </service>
     </services>
 
@@ -27,6 +25,6 @@
         <dependency 
type="org.apache.avalon.cornerstone.services.threads.ThreadManager"/>
     </dependencies>
 
-    <configuration-schema type="rlng"/>
+    <configuration-schema type="http://relaxng.org/ns/structure/1.0"/>
 
 </component-info>
Index: 
sourceresolve/src/java/org/apache/excalibur/source/impl/SourceResolverImpl.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/SourceResolverImpl.java,v
retrieving revision 1.15
diff -u -r1.15 SourceResolverImpl.java
--- 
sourceresolve/src/java/org/apache/excalibur/source/impl/SourceResolverImpl.java 
    12 Nov 2002 04:04:53 -0000      1.15
+++ 
sourceresolve/src/java/org/apache/excalibur/source/impl/SourceResolverImpl.java 
    28 Nov 2002 08:10:33 -0000
@@ -149,11 +149,11 @@
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
         if( loader == null )
         {
-            loader = this.getClass().getClassLoader();
+            loader = getClass().getClassLoader();
         }
         try
         {
-            this.m_urlSourceClass = loader.loadClass( urlSourceClassName );
+            m_urlSourceClass = loader.loadClass( urlSourceClassName );
         }
         catch( ClassNotFoundException cnfe )
         {
/*
 * Copyright (C) The Apache Software Foundation. All rights reserved.
 *
 * This software is published under the terms of the Apache Software License
 * version 1.1, a copy of which has been included  with this distribution in
 * the LICENSE.txt file.
 */
package org.apache.avalon.framework.tools.infobuilder;

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import org.apache.avalon.framework.info.ComponentInfo;
import org.apache.avalon.framework.info.DependencyDescriptor;
import org.apache.avalon.framework.info.FeatureDescriptor;
import org.apache.avalon.framework.info.SchemaDescriptor;
import org.apache.avalon.framework.info.ServiceDescriptor;

/**
 * Write [EMAIL PROTECTED] ComponentInfo} objects to a stream as xml
 * documents in legacy BlockInfo format.
 *
 * @author <a href="mailto:peter at apache.org">Peter Donald</a>
 * @version $Revision: 1.8 $ $Date: 2002/11/24 12:15:26 $
 */
public class LegacyBlockInfoWriter
    implements InfoWriter
{
    /**
     * Write out info representation to xml.
     *
     * @param info the info object
     * @param outputStream the stream to write to
     * @throws IOException if unable to write xml
     */
    public void writeComponentInfo( final ComponentInfo info,
                                    final OutputStream outputStream )
        throws Exception
    {
        final Writer writer = new OutputStreamWriter( outputStream );
        writeHeader( writer );
        writeDoctype( writer );
        writer.write( "<blockinfo>" );
        writeBlock( writer, info );
        writeServices( writer, info.getServices() );
        writeMxServices( writer, info.getServices() );
        writeDependencies( writer, info.getDependencies() );
        writer.write( "</blockinfo>" );
        writer.flush();
    }

    private void writeHeader( final Writer writer )
        throws IOException
    {
        writer.write( "<?xml version=\"1.0\" ?>" );
    }

    /**
     * Write out DOCType delcaration.
     *
     * @param writer the writer
     * @throws IOException if unable to write xml
     */
    private void writeDoctype( final Writer writer )
        throws IOException
    {
        final String doctype =
            "<!DOCTYPE blockinfo " +
            "PUBLIC \"-//PHOENIX/Block Info DTD Version 1.0//EN\" " +
            "\"http://jakarta.apache.org/avalon/dtds/phoenix/blockinfo_1_0.dtd\";>";
        writer.write( doctype );
    }

    /**
     * Write out xml representation of a component.
     *
     * @param writer the writer
     * @param info the component info
     * @throws IOException if unable to write xml
     */
    private void writeBlock( final Writer writer,
                             final ComponentInfo info )
        throws IOException
    {
        writer.write( "<block>\n" );
        writer.write( "  <version>1.0</version>" );

        final SchemaDescriptor schema = info.getConfigurationSchema();
        if( null != schema )
        {
            final String output =
                "  <schema-type>" + schema.getType() + "</schema-type>";
            writer.write( output );
        }

        writer.write( "</block>" );
    }

    /**
     * Write out xml representation of a set of services.
     *
     * @param writer the writer
     * @param services the services
     * @throws IOException if unable to write xml
     */
    private void writeServices( final Writer writer,
                                final ServiceDescriptor[] services )
        throws IOException
    {
        if( 0 == services.length )
        {
            return;
        }

        writer.write( "<services>" );
        for( int i = 0; i < services.length; i++ )
        {
            final ServiceDescriptor service = services[ i ];
            if( !LegacyUtil.isMxService( service ) )
            {
                writeService( writer, service.getType(), service );
            }
        }
        writer.write( "</services>" );
    }


    /**
     * Write out xml representation of a set of services.
     *
     * @param writer the writer
     * @param services the services
     * @throws IOException if unable to write xml
     */
    private void writeMxServices( final Writer writer,
                                final ServiceDescriptor[] services )
        throws IOException
    {
        if( 0 == services.length )
        {
            return;
        }

        writer.write( "<management-access-points>" );
        for( int i = 0; i < services.length; i++ )
        {
            final ServiceDescriptor service = services[ i ];
            if( LegacyUtil.isMxService( service ) )
            {
                writeService( writer, service.getType(), service );
            }
        }
        writer.write( "</management-access-points>" );
    }

    /**
     * Write out xml representation of a set of dependencies.
     *
     * @param writer the writer
     * @param dependencies the dependencies
     * @throws IOException if unable to write xml
     */
    private void writeDependencies( final Writer writer,
                                    final DependencyDescriptor[] dependencies )
        throws IOException
    {
        if( 0 == dependencies.length )
        {
            return;
        }

        writer.write( "<dependencies>" );
        for( int i = 0; i < dependencies.length; i++ )
        {
            final DependencyDescriptor dependency = dependencies[ i ];
            if( dependency.isOptional() )
            {
                continue;
            }

            writer.write( "<dependency>" );
            final String key = dependency.getKey();
            final String type = dependency.getType();
            if( !key.equals( type ) )
            {
                writer.write( "<role>" );
                writer.write( key );
                writer.write( "</role>" );
            }
            writeService( writer, type, dependency );
            writer.write( "</dependency>" );
        }
        writer.write( "</dependencies>" );
    }

    /**
     * Write out xml representation of a service.
     *
     * @param writer the writer
     * @param type the type of the service
     * @param feature the feature describing service
     * @throws IOException if unable to write xml
     */
    private void writeService( final Writer writer,
                               final String type,
                               final FeatureDescriptor feature )
        throws IOException
    {
        writer.write( "<service name=\"" );
        writer.write( type );

        final String version = LegacyUtil.getVersionString( feature );
        if( null != version )
        {
            writer.write( "\" version=\"" );
            writer.write( version );
        }

        writer.write( "\"/>" );
    }

}
/*
 * Copyright (C) The Apache Software Foundation. All rights reserved.
 *
 * This software is published under the terms of the Apache Software License
 * version 1.1, a copy of which has been included  with this distribution in
 * the LICENSE.txt file.
 */
package org.apache.avalon.framework.tools.infobuilder;

import org.apache.avalon.framework.info.Attribute;
import org.apache.avalon.framework.info.ContextDescriptor;
import org.apache.avalon.framework.info.EntryDescriptor;
import org.apache.avalon.framework.info.FeatureDescriptor;
import org.apache.avalon.framework.info.ServiceDescriptor;
import org.apache.avalon.framework.info.ComponentInfo;
import org.apache.avalon.framework.info.LoggerDescriptor;
import org.apache.avalon.framework.info.DependencyDescriptor;
import org.apache.avalon.framework.info.ComponentDescriptor;
import org.apache.avalon.framework.Version;
import java.util.Properties;

/**
 * This is a set of constants and utility methods
 * to enablesupport of Legacy BlockInfo files.
 *
 * @author <a href="mailto:peter at apache.org">Peter Donald</a>
 * @version $Revision:$ $Date:$
 */
public class LegacyUtil
{
    public static final String MX_ATTRIBUTE_NAME = "phoenix:mx";
    public static final Attribute MX_ATTRIBUTE = new Attribute( MX_ATTRIBUTE_NAME, null );
    public static final String VERSION_ATTRIBUTE_NAME = "phoenix:version";
    public static final String VERSION_ATTRIBUTE_PARAMETER = "version";
    public static final ContextDescriptor CONTEXT_DESCRIPTOR =
        new ContextDescriptor( "org.apache.avalon.phoenix.BlockContext",
                               EntryDescriptor.EMPTY_SET,
                               Attribute.EMPTY_SET );

    private LegacyUtil()
    {
    }

    /**
     * Return the version specified (if any) for feature.
     *
     * @param type the type
     * @return the translated schema type
     */
    public static String translateToSchemaUri( final String type )
    {
        if( type.equals( "relax-ng" ) )
        {
            return "http://relaxng.org/ns/structure/1.0";;
        }
        else
        {
            return type;
        }
    }

    /**
     * Return the version specified (if any) for feature.
     *
     * @param feature the feature
     * @return the version string
     */
    public static String getVersionString( final FeatureDescriptor feature )
    {
        final Attribute tag = feature.getAttribute( "avalon" );
        if( null != tag )
        {
            return tag.getParameter( "version" );
        }
        return null;
    }

    public static Attribute createVersionAttribute( final String version )
    {
        final Properties parameters = new Properties();
        parameters.setProperty( VERSION_ATTRIBUTE_PARAMETER, version );
        return new Attribute( VERSION_ATTRIBUTE_NAME, parameters );
    }

    /**
     * Return true if specified service is a management service.
     *
     * @param service the service
     * @return true if specified service is a management service, false otherwise.
     */
    public static boolean isMxService( final ServiceDescriptor service )
    {
        final Attribute tag = service.getAttribute( MX_ATTRIBUTE_NAME );
        return null != tag;
    }

    /**
     * Create a version for a feature. Defaults to 1.0 if not specified.
     *
     * @param feature the feature
     * @return the Version object
     */
    public static Version toVersion( final FeatureDescriptor feature )
    {
        final String version = getVersionString( feature );
        if( null == version )
        {
            return new Version( 1, 0, 0 );
        }
        else
        {
            return Version.getVersion( version );
        }
    }

    /**
     * Create a [EMAIL PROTECTED] ComponentInfo} for a Listener with specified classname.
     *
     * @param implementationKey the classname of listener
     * @return the ComponentInfo for listener
     */
    public static ComponentInfo createListenerInfo( final String implementationKey )
    {
        final ComponentDescriptor descriptor =
            new ComponentDescriptor( implementationKey, Attribute.EMPTY_SET );
        return new ComponentInfo( descriptor,
                                  ServiceDescriptor.EMPTY_SET,
                                  LoggerDescriptor.EMPTY_SET,
                                  ContextDescriptor.EMPTY_CONTEXT,
                                  DependencyDescriptor.EMPTY_SET,
                                  null,
                                  null );
    }
}
/*
 * Copyright (C) The Apache Software Foundation. All rights reserved.
 *
 * This software is published under the terms of the Apache Software License
 * version 1.1, a copy of which has been included  with this distribution in
 * the LICENSE.txt file.
 */
package org.apache.excalibur.containerkit.registry;

import org.apache.excalibur.containerkit.metadata.PartitionMetaData;

/**
 * The PartitionProfile contains the set of data required
 * to construct a specific instance of a Profile. It contains
 * a set of child PartitionProfile and [EMAIL PROTECTED] ComponentProfile}
 * objects.
 *
 * @author <a href="mailto:peter at apache.org">Peter Donald</a>
 * @version $Revision: 1.13 $ $Date: 2002/08/18 03:34:28 $
 */
public class PartitionProfile
{
    /**
     * Constant for an empty set of partitions.
     */
    public static final PartitionProfile[] EMPTY_SET = new PartitionProfile[ 0 ];

    /**
     * The [EMAIL PROTECTED] PartitionMetaData} for this partition.
     */
    private final PartitionMetaData m_metaData;

    /**
     * An array of partitions that are contained by this
     * object.
     */
    private final PartitionProfile[] m_partitions;

    /**
     * An array of partitions that are contained by this
     * object.
     */
    private final ComponentProfile[] m_components;

    /**
     * Create a PartitionProfile.
     *
     * @param metaData the meta data about this profile
     * @param partitions the partitions contained by this partition
     * @param components the components contained by this partition
     */
    public PartitionProfile( final PartitionMetaData metaData,
                             final PartitionProfile[] partitions,
                             final ComponentProfile[] components )
    {
        if( null == metaData )
        {
            throw new NullPointerException( "metaData" );
        }
        if( null == partitions )
        {
            throw new NullPointerException( "partitions" );
        }
        if( null == components )
        {
            throw new NullPointerException( "components" );
        }

        m_metaData = metaData;
        m_partitions = partitions;
        m_components = components;
    }

    /**
     * Return the metaData about this profile.
     *
     * @return the metaData about this profile.
     */
    public PartitionMetaData getMetaData()
    {
        return m_metaData;
    }

    /**
     * Return the set of partitions contained in this partition.
     *
     * @return the set of partitions contained in this partition.
     */
    public PartitionProfile[] getPartitions()
    {
        return m_partitions;
    }

    /**
     * Return the set of components contained in this partition.
     *
     * @return the set of components contained in this partition.
     */
    public ComponentProfile[] getComponents()
    {
        return m_components;
    }

    /**
     * Return the partition with specified name.
     *
     * @return the partition with specified name.
     */
    public PartitionProfile getPartition( final String name )
    {
        for( int i = 0; i < m_partitions.length; i++ )
        {
            final PartitionProfile partition = m_partitions[ i ];
            if( partition.getMetaData().getName().equals( name ) )
            {
                return partition;
            }
        }
        return null;
    }

    /**
     * Return the component with specified name.
     *
     * @return the component with specified name.
     */
    public ComponentProfile getComponent( final String name )
    {
        for( int i = 0; i < m_components.length; i++ )
        {
            final ComponentProfile component = m_components[ i ];
            if( component.getMetaData().getName().equals( name ) )
            {
                return component;
            }
        }
        return null;
    }
}
/*
 * Copyright (C) The Apache Software Foundation. All rights reserved.
 *
 * This software is published under the terms of the Apache Software License
 * version 1.1, a copy of which has been included with this distribution in
 * the LICENSE.txt file.
 */
package org.apache.excalibur.containerkit.registry;

import java.util.Map;

/**
 * Load metadata for an Assembly from some source.
 * The source is usually one or more xml config files.
 *
 * @author <a href="mailto:peter at apache.org">Peter Donald</a>
 * @version $Revision: 1.2 $ $Date: 2002/10/02 01:52:19 $
 */
public interface ProfileBuilder
{
    /**
     * Load metadata from a particular source
     * using specified map of parameters. The content
     * of the parameters is left unspecified.
     *
     * @param parameters the parameters indicating method to load meta data source
     * @return the set of components in metadata
     * @throws Exception if unable to load or resolve
     *         meta data for any reason
     */
    PartitionProfile buildProfile( Map parameters )
        throws Exception;
}
/*
 * Copyright (C) The Apache Software Foundation. All rights reserved.
 *
 * This software is published under the terms of the Apache Software License
 * version 1.1, a copy of which has been included  with this distribution in
 * the LICENSE.txt file.
 */
package org.apache.excalibur.containerkit.metadata;

import org.apache.avalon.framework.info.Attribute;
import org.apache.avalon.framework.info.FeatureDescriptor;

/**
 * In each Assembly there may be groups of components that
 * are activated together and treated as a group. These
 * components are all "visible" to each other as peers.
 * The group will have a name and may use resources from
 * other partitions. Partitions can also be nested one inside
 * each other.
 *
 * @author <a href="mailto:peter at apache.org">Peter Donald</a>
 * @version $Revision: 1.13 $ $Date: 2002/08/18 03:34:28 $
 */
public class PartitionMetaData
    extends FeatureDescriptor
{
    /**
     * Constant for an empty set of partitions.
     */
    public static final PartitionMetaData[] EMPTY_SET = new PartitionMetaData[ 0 ];

    /**
     * The name of the partition. This is an
     * abstract name used during assembly.
     */
    private final String m_name;

    /**
     * An array listing the set of other partitions required by
     * this partition. The required partitions must be initialized
     * and in ready state prior to this partition starting and this
     * partition must be shutdown prior
     */
    private final String[] m_depends;

    /**
     * AN array of partitions that are contained by this
     * object.
     */
    private final PartitionMetaData[] m_partitions;

    /**
     * AN array of components that are contained by this
     * object.
     */
    private final ComponentMetaData[] m_components;

    /**
     * Create a PartitionMetaData.
     *
     * @param name the abstract name of component meta data instance
     * @param depends the partitions depended upon by this parition
     * @param partitions the partitions contained by this partition
     * @param components the components contained by this partition
     * @param attributes the extra attributes that are used to describe component
     */
    public PartitionMetaData( final String name,
                              final String[] depends,
                              final PartitionMetaData[] partitions,
                              final ComponentMetaData[] components,
                              final Attribute[] attributes )
    {
        super( attributes );
        if( null == name )
        {
            throw new NullPointerException( "name" );
        }
        if( null == depends )
        {
            throw new NullPointerException( "depends" );
        }
        if( null == partitions )
        {
            throw new NullPointerException( "partitions" );
        }
        if( null == components )
        {
            throw new NullPointerException( "components" );
        }

        m_name = name;
        m_depends = depends;
        m_partitions = partitions;
        m_components = components;
    }

    /**
     * Return the name of component profile.
     *
     * @return the name of the component profile.
     */
    public String getName()
    {
        return m_name;
    }

    /**
     * Return the set of prereqs for this partition.
     *
     * @return the set of prereqs for this partition.
     */
    public String[] getDepends()
    {
        return m_depends;
    }

    /**
     * Return the set of partitions contained in this partition.
     *
     * @return the set of partitions contained in this partition.
     */
    public PartitionMetaData[] getPartitions()
    {
        return m_partitions;
    }

    /**
     * Return the set of components contained in this partition.
     *
     * @return the set of components contained in this partition.
     */
    public ComponentMetaData[] getComponents()
    {
        return m_components;
    }

    /**
     * Return the partition with specified name.
     *
     * @return the partition with specified name.
     */
    public PartitionMetaData getPartition( final String name )
    {
        for( int i = 0; i < m_partitions.length; i++ )
        {
            final PartitionMetaData partition = m_partitions[ i ];
            if( partition.getName().equals( name ) )
            {
                return partition;
            }
        }
        return null;
    }

    /**
     * Return the component with specified name.
     *
     * @return the component with specified name.
     */
    public ComponentMetaData getComponent( final String name )
    {
        for( int i = 0; i < m_components.length; i++ )
        {
            final ComponentMetaData component = m_components[ i ];
            if( component.getName().equals( name ) )
            {
                return component;
            }
        }
        return null;
    }
}

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to