mcconnell    2002/07/12 08:11:58

  Modified:    assembly README.TXT build.xml kernel.bat
               assembly/demo/src/java/org/apache/excalibur/playground
                        ComplexComponent.java ComplexComponent.xinfo
               assembly/src/etc kernel.xml project.mf
               assembly/src/java/org/apache/excalibur/merlin Container.java
                        ResourceProvider.java Selector.java
               assembly/src/java/org/apache/excalibur/merlin/container
                        DefaultContainer.java LifecycleHelper.java
                        ProfileRegistry.java
               assembly/src/java/org/apache/excalibur/merlin/kernel
                        DefaultKernel.java
               assembly/src/java/org/apache/excalibur/meta/info
                        DefaultType.java
               assembly/src/java/org/apache/excalibur/meta/verifier
                        Resources.properties package.html
  Added:       assembly/src/java/org/apache/excalibur/meta/info/builder
                        SerializedTypeCreator.java TypeBuilder.java
                        TypeCreator.java XMLTypeCreator.java
  Log:
  rationalization between coontainer and kernel
  
  Revision  Changes    Path
  1.9       +13 -8     jakarta-avalon-excalibur/assembly/README.TXT
  
  Index: README.TXT
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/README.TXT,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- README.TXT        8 Jul 2002 09:57:35 -0000       1.8
  +++ README.TXT        12 Jul 2002 15:11:56 -0000      1.9
  @@ -12,6 +12,9 @@
   Status
   ------
   
  +11-JUL-2002.
  +Complete logging framework based on excalibure-logger-1.0 with a logging 
configuration model that allows the declaration of logging configuration at the root 
level, realateve to containers within the container hierachy, and against individual 
components.
  +
   08-JUL-2002.
   Instantion of components based on profile criteria in place and operational.
   
  @@ -24,11 +27,7 @@
   To-Do
   -----
   
  -Addition of pooled support under a service manager variant as part Merlin 1.
  -
  -The kernel should take advantage of Excalibur LogKit extensions (logging 
configuration etc.). Functional operation of the container as a node in a container 
hierarchy is still very much work-in-progress.  
  -
  -The component instantiation and lifecycle management is not included at this stage. 
 Before proceeding with actual component instantiation - more playing around is 
required with the containerkit abstractions.
  +Addition of pooled support under a service manager variant as per Merlin 1.
   
   Context creation is based on the current ContextFactory class.  This needs to be 
updated in accordance with the specifications for context and context value creation 
directives.  Also, the registry needs to be updated to provide support for the import 
of container based context values (refer spec).
   
  @@ -36,11 +35,17 @@
   
   Introduction of component factories will be required as a complement to the 
<component/> directive - e.g <factory/>.
   
  -Addition of support for compoents that are not declared in the manifest.
  +An instantial scheduling policy will be introduced to enable the explicit 
declaration of lazy or immediate activation.  Immediate activation will support 
requirements for server style components that wil be launched on startup of the 
kernel.  Lazy activation policy will delay the activation of a service until a client 
application issues a lookup request.
  +
  +Additional support will be added for for compoents that are not declared in jar 
manifest.  In addition, it would be desirable that references to component that do not 
have a accompanying .xinfo file should be usable as simple service components using 
class introspection (i.e. creation of a type descriptor dynamically).
  +
  +Upgrading of error handling against classic fail scenarios (class not in classpath, 
manifest errors, informative configuration errors).
  +
  +Gentle degrade of service deployment profile on error - if a component cannot be 
deployed, disable the activation of all of the dependent service but continue on with 
deployment of the remaining services (currently the situation is somewhat of a domino 
failure effect - if a supplier service fails, a dependent will fail because the 
supplier failed - this situation can be avoided by disabling depenedent services in 
fail conditions).
   
  -Upgrading of error handling against classic fail scenarios (class not in classpath, 
manafest errors, informative configuration errors).
  +Inclusion of explicit directives concerning assembly should be included although 
quite complex dependecy maps are readily managable using strait-forward logic based 
assembly of suppliers and consumers.
   
  -Gentle degrade of service deployment profile on error - if a component cannot be 
deployed, disable the activation of all of the dependent but continue on with 
deployment of the rest.
  +Container based supply of services and context is pending.  Currently services are 
resolvable within the same container and any parent container.  It would be desirable 
to provide support for the exporting of a service from one container into another.
   
   Stephen McConnell
   [EMAIL PROTECTED]
  
  
  
  1.16      +20 -16    jakarta-avalon-excalibur/assembly/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/build.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- build.xml 9 Jul 2002 10:24:37 -0000       1.15
  +++ build.xml 12 Jul 2002 15:11:56 -0000      1.16
  @@ -37,7 +37,7 @@
     <property name="etc" value="${src}/etc" />
     <property name="build"  value="build" />
     <property name="dist"  value="dist" />
  -  <property name="deploy"  value="deploy" />
  +  <property name="extensions"  value="extensions" />
   
     <property name="javadoc.root.path"  value="${dist}/javadoc" />
     <property name="avalon.href"  value="http://jakarta.apache.org/avalon/api/"; />
  @@ -48,6 +48,7 @@
     <property name="meta.jar" value="avalon-meta.jar" />
     <property name="merlin.page" value="${src}/etc/merlin.html" />
     <property name="meta.page" value="${src}/etc/meta.html" />
  +  <property name="merlin.jar" value="merlin.jar" />
   
     <!-- classpath -->
   
  @@ -67,7 +68,7 @@
     <target name="clean">
        <delete dir="${build}"/>
        <delete dir="${dist}"/>
  -     <delete dir="${deploy}"/>
  +     <delete dir="${extensions}"/>
     </target>
   
     <!-- PREPARE -->
  @@ -84,7 +85,7 @@
   
     <target name="merlin.context" depends="prepare">
       <mkdir dir="dist"/>
  -    <uptodate property="uptodate" targetfile="${dist}/${ant.project.name}.jar">
  +    <uptodate property="uptodate" targetfile="${dist}/${merlin.jar}">
         <srcfiles dir="${src}/java">
            <include name="**/merlin/**/*.*"/>
         </srcfiles>
  @@ -97,7 +98,7 @@
     <target name="merlin.build" depends="merlin.context,meta.build" unless="uptodate" 
>
         <echo message="Building Merlin"/>
         <mkdir dir="${build}/main"/>
  -      <javac debug="off" destdir="${build}/main" deprecation="true"
  +      <javac debug="off" destdir="${build}/main" deprecation="false"
           includes="org/apache/excalibur/merlin/**">
           <classpath>
            <path refid="project.classpath" />
  @@ -112,7 +113,7 @@
             <include name="**/merlin/**/*.properties"/>
           </fileset>
         </copy>
  -      <jar jarfile="${dist}/${ant.project.name}.jar" 
  +      <jar jarfile="${dist}/${merlin.jar}" 
            basedir="${build}/main" manifest="${etc}/${project.manifest}"/>
     </target>
   
  @@ -126,7 +127,7 @@
     </target>
   
     <target name="meta.build" depends="meta.context" unless="meta.uptodate" >
  -      <echo message="Building MetaModel"/>
  +      <echo message="Building Meta Info Model"/>
         <mkdir dir="${build}/meta"/>
         <javac debug="off" destdir="${build}/meta" deprecation="true"
           includes="org/apache/excalibur/meta/**">
  @@ -191,7 +192,7 @@
       </copy>
     </target>
   
  -  <target name="javadoc" depends="merlin.javadoc" />
  +  <target name="javadoc" depends="meta.javadoc,merlin.javadoc" />
   
     <target name="merlin.javadoc" depends="build" >
       <echo message="path: ${javadoc.root.path}/${ant.project.name}"/>
  @@ -200,7 +201,7 @@
        doctitle="&lt;h1&gt;${project.title}&lt;/h1&gt;" 
         noindex="false" author="false" 
         use="true"
  -     windowtitle="Assembly" 
  +     windowtitle="Merlin" 
         additionalparam="-breakiterator -J-Xmx128m"
         packagenames="org.apache.excalibur.merlin.*" 
         overview="${merlin.page}"
  @@ -208,7 +209,8 @@
           <sourcepath path="${src}/java"/>
           <classpath>
            <path refid="project.classpath" />
  -          <pathelement path="${dist}/${ant.project.name}.jar}" />
  +          <pathelement path="${dist}/${merlin.jar}" />
  +          <pathelement path="${dist}/${meta.jar}" />
          </classpath>
          <link href="${jdk.href}" />
          <link href="${avalon.href}" />
  @@ -241,15 +243,15 @@
     </target>
   
     <target name="deploy" depends="build">
  -     <mkdir dir="${deploy}"/>
  -     <copy todir="${deploy}" preservelastmodified="true">
  +     <mkdir dir="${extensions}"/>
  +     <copy todir="${extensions}" preservelastmodified="true">
          <fileset dir="${dist}">
            <include name="${meta.jar}"/>
  -         <include name="assembly.jar"/>
  +         <include name="${merlin.jar}"/>
          </fileset>
          <fileset dir="${lib}">
  -         <include name="avalon-framework.jar"/>
            <include name="logkit.jar"/>
  +         <include name="avalon-framework.jar"/>
            <include name="excalibur-i18n-1.0.jar" />
            <include name="excalibur-extension-1.0a.jar" />
            <include name="excalibur-configuration-1.0.jar" />
  @@ -259,14 +261,16 @@
     </target>
   
     <target name="kernel" depends="deploy">
  -     <java jar="deploy/assembly.jar" fork="true">
  +     <java jar="${extensions}/${merlin.jar}" fork="true">
          <arg value="${src}/etc/kernel.xml"/>
        </java>
     </target>
   
     <target name="patch">
  -    <replace token="AssociationMap" value="DependencyGraph" dir="src/java">
  -        <include name="**/*.*"/>
  +    <replace 
  +       token="org.apache.excalibur.merlin.meta.data" 
  +       value="org.apache.excalibur.merlin.model" dir="src/java">
  +     <include name="org/apache/excalibur/merlin/**/*.*"/>
       </replace>
     </target>
   
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/assembly/kernel.bat
  
  Index: kernel.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/kernel.bat,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- kernel.bat        7 Jul 2002 23:49:44 -0000       1.1
  +++ kernel.bat        12 Jul 2002 15:11:56 -0000      1.2
  @@ -1 +1 @@
  -java -classpath 
dist\assembly.jar;dist\avalon-meta.jar;deploy\excalibur-i18n-1.0.jar;deploy\avalon-framework.jar;deploy\logkit.jar;deploy\excalibur-extension-1.0a.jar;deploy\excalibur-configuration-1.0.jar
 org.apache.excalibur.merlin.kernel.Main src/etc/kernel.xml
  +java -classpath 
dist\merlin.jar;dist\avalon-meta.jar;deploy\excalibur-i18n-1.0.jar;deploy\avalon-framework.jar;deploy\logkit.jar;deploy\excalibur-extension-1.0a.jar;deploy\excalibur-configuration-1.0.jar;deploy\excalibur-logger-1.0.jar
  org.apache.excalibur.merlin.Main src/etc/kernel.xml
  
  
  
  1.4       +3 -1      
jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ComplexComponent.java
  
  Index: ComplexComponent.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ComplexComponent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ComplexComponent.java     4 Jul 2002 09:01:32 -0000       1.3
  +++ ComplexComponent.java     12 Jul 2002 15:11:57 -0000      1.4
  @@ -46,7 +46,6 @@
       {
           if( getLogger().isDebugEnabled() )
             getLogger().debug("service");
  -
          m_manager = manager;
       }
   
  @@ -78,6 +77,9 @@
           m_simple = (SimpleService) m_manager.lookup( "simple" );
           m_basic = (BasicService) m_manager.lookup( "basic" );
   
  +        getLogger().getChildLogger("init").debug("internally ready");
  +        if( getLogger().isInfoEnabled() )
  +          getLogger().info("ready");
       }
   
       //=======================================================================
  
  
  
  1.6       +4 -0      
jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ComplexComponent.xinfo
  
  Index: ComplexComponent.xinfo
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/ComplexComponent.xinfo,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ComplexComponent.xinfo    7 Jul 2002 23:06:39 -0000       1.5
  +++ ComplexComponent.xinfo    12 Jul 2002 15:11:57 -0000      1.6
  @@ -9,6 +9,10 @@
       <name>complex-component</name>
     </component>
   
  +  <loggers>
  +     <logger name="init"/>
  +  </loggers>
  +
     <dependencies>
         <dependency>
             <role>basic</role>
  
  
  
  1.8       +43 -16    jakarta-avalon-excalibur/assembly/src/etc/kernel.xml
  
  Index: kernel.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/kernel.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- kernel.xml        9 Jul 2002 11:09:12 -0000       1.7
  +++ kernel.xml        12 Jul 2002 15:11:57 -0000      1.8
  @@ -7,28 +7,29 @@
   
      <!--
      Optional logging catagory creation directive.  The logging element declares
  -   the default logging priority.  Child elements contain category declarations 
  -   which must include a name (the logging catagory), and may optionally include
  -   a target and a priority attribute.  The target defaults of "default" which 
  -   corresponds to a internal default logging target that issue messages to 
  -   System.out.  If the target is declared, it must refer to a named target 
  +   the application wide default logging priority.  
  +   A target element enables defintion of a logging file to which log entries will 
  +   be directed.  The target name attribute is the name referenced by category 
elements
  +   defined within the loggers element. Child category declarations must include a 
name 
  +   (the logging catagory), and may optionally include a target and a priority 
attribute.  
  +   The target defaults of "default" which corresponds to a internal default logging 
  +   target that issue messages to System.out (unless overriden by a target named 
default).  
  +   If the target is declared inside a catagory element, it must refer to a named 
target 
      element.  The priority attribute may container one of the values 
<code>DEBUG</code>
      <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code> or <code>ERROR</code>.
  -   A target element enables defintion of a logging file to which logg entries will 
  -   be directed.  The name attribute is the name referenced by category elements.  
      The target must contain a single file element with the attribute 
<code>location</code>
      the corresponds to the name of the logging file.
      -->
   
  -   <logging priority="INFO">
  -      <category priority="INFO"  name="kernel" />
  -      <category priority="INFO"  name="kernel.loader" />
  -      <category priority="INFO"  name="kernel.container" />
  -      <category priority="INFO"  name="kernel.container.profiles" />
  -      <category priority="INFO"  name="kernel.container.types" />
  +   <logging priority="INFO" target="default">
         <target name="kernel">
           <file location="kernel.log" />
         </target>
  +      <loggers priority="INFO">
  +        <category name="logging" priority="WARN" />
  +        <category name="loader" priority="WARN" />
  +        <category name="installer" priority="WARN"  />
  +      </loggers>
      </logging>
   
      <!--
  @@ -47,13 +48,27 @@
   
      <container name="root">
   
  +     <!--
  +     A container has a number of internal logging catagories that you can modify to
  +     see what's going on.  The following declaration is equivalent to the default
  +     behviour is nothing is specified.
  +     -->
  +
  +     <loggers priority="INFO">
  +       <category priority="DEBUG"  name="loader" />
  +       <category priority="DEBUG"  name="types" />
  +       <category priority="WARN"  name="types.builder" />
  +       <category priority="WARN"  name="profiles" />
  +       <category priority="WARN"  name="lifecycle" />
  +       <category priority="WARN"  name="verifier" />
  +     </loggers>
  +
        <classpath>
          <fileset dir="dist">
            <include name="demo.jar"/>
          </fileset>
        </classpath>
   
  -
        <!--
        Declaration of the services hosted by this container.  Service container here 
        will be managed relative to other provider components at the same level and 
  @@ -62,6 +77,10 @@
   
        <component name="complex" 
class="org.apache.excalibur.playground.ComplexComponent">
   
  +        <loggers priority="DEBUG">
  +          <category name="init" priority="DEBUG" />
  +        </loggers>
  +
           <!--
           Include the following context value in the context supplied a component 
using this 
           profile.  Context entries are normally only required in the case where the 
component
  @@ -102,10 +121,17 @@
   
        <container name="sub-container">
   
  +       <loggers priority="INFO">
  +         <category priority="WARN"  name="loader" />
  +         <category priority="WARN"  name="types" />
  +         <category priority="WARN"  name="profiles" />
  +         <category priority="WARN"  name="lifecycle" />
  +       </loggers>
  +
          <classpath>
            <fileset dir="dist">
              <include name="demo.jar"/>
  -           <include name="assembly.jar"/>
  +           <include name="merlin.jar"/>
            </fileset>
          </classpath>
   
  @@ -117,7 +143,7 @@
          -->
   
          <!--
  -       <component name="test" 
class="org.apache.excalibur.merlin.kernel.DefaultContainer">
  +       <component name="test" class="org.apache.avalon.merlin.DefaultContainer">
            <configuration>
             <container>
              <classpath>
  @@ -138,6 +164,7 @@
         <component name="simple2" 
class="org.apache.excalibur.playground.SimpleComponent"/>
   
        </container>
  +     <container name="empty"/>
   
      </container>
   
  
  
  
  1.9       +2 -2      jakarta-avalon-excalibur/assembly/src/etc/project.mf
  
  Index: project.mf
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/project.mf,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- project.mf        9 Jul 2002 11:00:42 -0000       1.8
  +++ project.mf        12 Jul 2002 15:11:57 -0000      1.9
  @@ -8,9 +8,9 @@
   Class-Path: avalon-framework.jar logkit.jar excalibur-logger-1.0.jar 
excalibur-i18n-1.0.jar 
    excalibur-configuration-1.0.jar excalibur-extension-1.0a.jar 
    avalon-meta.jar 
  -Main-Class: org.apache.excalibur.merlin.kernel.Main
  +Main-Class: org.apache.excalibur.merlin.Main
   
  -Name: org/apache/excalibur/merlin/kernel/DefaultContainer.class
  +Name: org/apache/excalibur/merlin/container/DefaultContainer.class
   Avalon-Block: true
   
   Name: org/apache/excalibur/merlin/kernel/DefaultKernel.class
  
  
  
  1.3       +2 -2      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/Container.java
  
  Index: Container.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/Container.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Container.java    12 Jul 2002 12:04:54 -0000      1.2
  +++ Container.java    12 Jul 2002 15:11:57 -0000      1.3
  @@ -19,7 +19,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
    * @version $Revision$ $Date$
    */
  -public interface Container extends Manageable, Verifiable
  +public interface Container extends Manageable, Verifiable, ResourceLocator
   {
      /**
       * Return the set of potential profiles of installed component matching a 
dependency.
  
  
  
  1.2       +1 -8      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/ResourceProvider.java
  
  Index: ResourceProvider.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/ResourceProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResourceProvider.java     12 Jul 2002 11:58:14 -0000      1.1
  +++ ResourceProvider.java     12 Jul 2002 15:11:57 -0000      1.2
  @@ -96,11 +96,4 @@
       Parameters createParameters( Profile profile )
           throws Exception;
   
  -   /**
  -    * Requests to release all references to a profile and associated 
  -    * service instances.
  -    * @param profile the profile to release
  -    */
  -    public void release( Profile profile );
  -
   }
  
  
  
  1.2       +3 -1      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/Selector.java
  
  Index: Selector.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/Selector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Selector.java     12 Jul 2002 11:31:38 -0000      1.1
  +++ Selector.java     12 Jul 2002 15:11:57 -0000      1.2
  @@ -8,6 +8,8 @@
   
   package org.apache.excalibur.merlin;
   
  +import org.apache.excalibur.merlin.model.Profile;
  +
   
   /**
    * Interface implemented by a service selection implementation mechanism.  Classes 
  
  
  
  1.3       +48 -18    
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java
  
  Index: DefaultContainer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultContainer.java     12 Jul 2002 12:04:54 -0000      1.2
  +++ DefaultContainer.java     12 Jul 2002 15:11:57 -0000      1.3
  @@ -64,15 +64,13 @@
   import org.apache.excalibur.meta.info.DependencyDescriptor;
   import org.apache.excalibur.meta.info.ServiceDesignator;
   import org.apache.excalibur.meta.verifier.VerifyException;
  -import org.apache.excalibur.merlin.meta.data.Profile;
  -import org.apache.excalibur.merlin.meta.data.ComponentDescriptor;
  -import org.apache.excalibur.merlin.meta.data.ContainerDescriptor;
  -import org.apache.excalibur.merlin.meta.data.CategoryDescriptor;
  -import org.apache.excalibur.merlin.meta.data.verifier.AssemblyVerifier;
  -import org.apache.excalibur.merlin.meta.data.verifier.MetaDataVerifier;
  +import org.apache.excalibur.merlin.model.Profile;
  +import org.apache.excalibur.merlin.model.ComponentDescriptor;
  +import org.apache.excalibur.merlin.model.ContainerDescriptor;
  +import org.apache.excalibur.merlin.model.CategoryDescriptor;
  +import org.apache.excalibur.merlin.model.verifier.AssemblyVerifier;
  +import org.apache.excalibur.merlin.model.verifier.MetaDataVerifier;
   import org.apache.excalibur.merlin.kernel.ContainerClassLoader;
  -import org.apache.excalibur.merlin.kernel.DependencyGraph;
  -import org.apache.excalibur.merlin.kernel.DefaultProvider;
   import org.apache.excalibur.merlin.kernel.DefaultLoggerManager;
   import org.apache.excalibur.merlin.Container;
   import org.apache.excalibur.merlin.Verifiable;
  @@ -157,7 +155,7 @@
   
       private DependencyGraph m_map;
   
  -    private ResourceProvider m_provider;
  +    private DefaultProvider m_provider;
   
       private DefaultLoggerManager m_logging;
   
  @@ -176,6 +174,8 @@
       */
       private ProfileRegistry m_profiles; 
   
  +    private Hashtable m_profileToObjectMap = new Hashtable();
  +
       //=======================================================================
       // Contextualizable
       //=======================================================================
  @@ -189,15 +189,15 @@
           m_classloader = (ContainerClassLoader) context.get( CLASSLOADER_KEY );
           m_logging = (DefaultLoggerManager) context.get( LOG_MANAGER_KEY );
           m_descriptor = (ContainerDescriptor) context.get( CONTAINER_DESCRIPTOR_KEY 
);
  -        m_map = (DependencyGraph) context.get( MAP_KEY );
  -        m_provider = (ResourceProvider) context.get( PROVIDER_KEY );
           try
           {
               m_parent = (Container) context.get( CONTAINER_KEY );
  +            m_map = (DependencyGraph) context.get( MAP_KEY );
           }
           catch( ContextException e )
           {
               // root container
  +            m_map = new DependencyGraph();
           }
       }
   
  @@ -218,6 +218,7 @@
       {
           getLogger().debug("initilization");
           m_helper.enableLogging( getLogger().getChildLogger("lifecycle") );
  +        m_provider = new DefaultProvider( m_classloader, m_logging, this );
   
           // 
           // initiate profile creation
  @@ -307,7 +308,8 @@
                   {
                       if( getLogger().isDebugEnabled() )
                         getLogger().debug("starting: " + name );
  -                    m_helper.startup( name, profile, m_provider );
  +                    Object object = m_helper.startup( name, profile, m_provider );
  +                    m_profileToObjectMap.put( profile, object );
                       if( getLogger().isInfoEnabled() )
                         getLogger().info("started: " + name );
                   }
  @@ -336,13 +338,14 @@
                   final String name = profile.getName();
                   if( getLogger().isDebugEnabled() )
                     getLogger().debug("stopping: " + name );
  -                Object object = m_provider.getSingletonInstance( profile );
  +                
  +                Object object = m_profileToObjectMap.get( profile );
                   if( object != null )
                   {
                       try
                       {
                           m_helper.shutdown( name, object );
  -                        m_provider.release( profile );
  +                        m_profileToObjectMap.remove( profile );
                           if( getLogger().isInfoEnabled() )
                             getLogger().info("stopped: " + name );
                       }
  @@ -429,6 +432,35 @@
       }
   
       //=======================================================================
  +    // ResourceLocator
  +    //=======================================================================
  +
  +   /**
  +    * Get a service instance for the supplied profile.
  +    * @param provider the key to the provider instance
  +    */
  +    public Object lookup( Profile provider )
  +    {
  +        Object object = m_profileToObjectMap.get( provider );
  +        if( object == null )
  +        {
  +            object = m_parent.lookup( provider );
  +        }
  +        return object;
  +    }
  +
  +   /**
  +    * Requests to release all references to a profile and associated 
  +    * service instances.
  +    * @param profile the profile to release
  +    */
  +    public void release( Object object )
  +    {
  +       // only dealing with singletons for now
  +    }
  +
  +
  +    //=======================================================================
       // Disposable
       //=======================================================================
   
  @@ -527,13 +559,11 @@
   
           DependencyGraph map = new DependencyGraph( m_map );
           m_map.addChild( map );
  -        DefaultProvider provider = new DefaultProvider( m_provider, m_classloader, 
m_logging );
  -        provider.enableLogging( logger.getChildLogger( "provider" ) );
  +
           DefaultContext context = new DefaultContext();
           context.put( CLASSLOADER_KEY, loader );
           context.put( CONTAINER_KEY, this );
           context.put( MAP_KEY, map );
  -        context.put( PROVIDER_KEY, provider );
           context.put( LOG_MANAGER_KEY, m_logging );
           context.put( CONTAINER_DESCRIPTOR_KEY, descriptor );
           context.makeReadOnly();
  
  
  
  1.2       +1 -0      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/LifecycleHelper.java
  
  Index: LifecycleHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/LifecycleHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LifecycleHelper.java      12 Jul 2002 12:05:28 -0000      1.1
  +++ LifecycleHelper.java      12 Jul 2002 15:11:57 -0000      1.2
  @@ -28,6 +28,7 @@
   import org.apache.avalon.framework.service.Serviceable;
   
   import org.apache.excalibur.merlin.model.Profile;
  +import org.apache.excalibur.merlin.ResourceProvider;
   
   /**
    * This is a class to help an Application manage the lifecycle of a component.
  
  
  
  1.3       +1 -2      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/ProfileRegistry.java
  
  Index: ProfileRegistry.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/ProfileRegistry.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProfileRegistry.java      12 Jul 2002 12:04:54 -0000      1.2
  +++ ProfileRegistry.java      12 Jul 2002 15:11:57 -0000      1.3
  @@ -35,7 +35,6 @@
   import org.apache.excalibur.merlin.model.ComponentDescriptor;
   import org.apache.excalibur.merlin.model.builder.ProfileBuilder;
   import org.apache.excalibur.merlin.Selector;
  -import org.apache.excalibur.merlin.kernel.DependencyGraph;
   import org.apache.excalibur.merlin.Container;
   
   /**
  
  
  
  1.11      +1 -10     
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/DefaultKernel.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultKernel.java        12 Jul 2002 12:04:54 -0000      1.10
  +++ DefaultKernel.java        12 Jul 2002 15:11:57 -0000      1.11
  @@ -162,13 +162,6 @@
           }
   
           //
  -        // provider setup
  -        //
  -
  -        DefaultProvider provider = new DefaultProvider( loader, m_logging );
  -        provider.enableLogging( getLogger().getChildLogger( "provider" ) );
  -
  -        //
           // container context creation
           //
   
  @@ -177,8 +170,6 @@
           context.put( DefaultContainer.CLASSLOADER_KEY, loader );
           context.put( DefaultContainer.LOG_MANAGER_KEY, m_logging );
           context.put( DefaultContainer.CONTAINER_DESCRIPTOR_KEY, m_descriptor );
  -        context.put( DefaultContainer.MAP_KEY, new DependencyGraph() );
  -        context.put( DefaultContainer.PROVIDER_KEY, provider );
           context.makeReadOnly();
   
           //
  
  
  
  1.3       +2 -4      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info/DefaultType.java
  
  Index: DefaultType.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info/DefaultType.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultType.java  7 Jul 2002 04:28:31 -0000       1.2
  +++ DefaultType.java  12 Jul 2002 15:11:58 -0000      1.3
  @@ -15,8 +15,6 @@
   import org.apache.excalibur.meta.info.LoggerDescriptor;
   import org.apache.excalibur.meta.info.ServiceDescriptor;
   import org.apache.excalibur.meta.info.ServiceDesignator;
  -import org.apache.excalibur.meta.data.Profile;
  -import org.apache.excalibur.meta.data.DefaultProfile;
   
   /**
    * This class contains the meta information about a particular
  @@ -70,7 +68,7 @@
           }
           if( null == dependencies )
           {
  -            throw new NullPointerException( "profiles" );
  +            throw new NullPointerException( "dependencies" );
           }
           m_descriptor = descriptor;
           m_loggers = loggers;
  
  
  
  1.1                  
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info/builder/SerializedTypeCreator.java
  
  Index: SerializedTypeCreator.java
  ===================================================================
  /*
   * 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.meta.info.builder;
  
  import org.apache.excalibur.meta.info.Type;
  import java.io.InputStream;
  import java.io.ObjectInputStream;
  
  /**
   * Create {@link Type} from stream made up of
   * serialized object.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Donald</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2002/07/12 15:11:58 $
   */
  public class SerializedTypeCreator
      implements TypeCreator
  {
      public Type createType( final String key,
                                                final InputStream inputStream )
          throws Exception
      {
          final ObjectInputStream ois = new ObjectInputStream( inputStream );
          return (Type)ois.readObject();
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info/builder/TypeBuilder.java
  
  Index: TypeBuilder.java
  ===================================================================
  /*
   * 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.meta.info.builder;
  
  import java.io.InputStream;
  import org.apache.avalon.excalibur.i18n.ResourceManager;
  import org.apache.avalon.excalibur.i18n.Resources;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.excalibur.meta.info.Type;
  
  /**
   * A TypeBuilder is responsible for building {@link Type}
   * objects from Configuration objects. The format for Configuration object
   * is specified in the <a href="package-summary.html#external">package summary</a>.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Donald</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2002/07/12 15:11:58 $
   */
  public final class TypeBuilder
      extends AbstractLogEnabled
  {
      private static final Resources REZ =
          ResourceManager.getPackageResources( TypeBuilder.class );
  
      private final TypeCreator m_xmlTypeCreator = createXMLTypeCreator();
      private final TypeCreator m_serialTypeCreator = new SerializedTypeCreator();
  
      /**
       * Setup logging for all subcomponents
       */
      public void enableLogging( final Logger logger )
      {
          super.enableLogging( logger );
          setupLogger( m_serialTypeCreator );
          if( null != m_xmlTypeCreator )
          {
              setupLogger( m_xmlTypeCreator );
          }
      }
  
      /**
       * Create a {@link Type} object for specified Class.
       *
       * @param clazz The class of Component
       * @return the created Type
       * @throws ConfigurationException if an error occurs
       */
      public Type build( final Class clazz )
          throws Exception
      {
          return build( clazz.getName(), clazz.getClassLoader() );
      }
  
      /**
       * Create a {@link Type} object for specified
       * classname, in specified ClassLoader.
       *
       * @param classname The classname of Component
       * @param classLoader the ClassLoader to load info from
       * @return the created Type
       * @throws ConfigurationException if an error occurs
       */
      public Type build( final String classname,
                                  final ClassLoader classLoader )
          throws Exception
      {
          final Type info = buildFromSerDescriptor( classname, classLoader );
          if( null != info )
          {
              return info;
          }
          else
          {
              return buildFromXMLDescriptor( classname, classLoader );
          }
      }
  
      /**
       * Build Type from the XML descriptor format.
       *
       * @param classname The classname of Component
       * @param classLoader the ClassLoader to load info from
       * @return the created Type
       * @throws Exception if an error occurs
       */
      private Type buildFromSerDescriptor( final String classname,
                                                    final ClassLoader classLoader )
          throws Exception
      {
          final String xinfo =
              classname.replace( '.', '/' ) + ".sinfo";
          final InputStream inputStream =
              classLoader.getResourceAsStream( xinfo );
          if( null == inputStream )
          {
              return null;
          }
  
          return m_serialTypeCreator.createType( classname, inputStream );
      }
  
      /**
       * Build Type from the XML descriptor format.
       *
       * @param classname The classname of Component
       * @param classLoader the ClassLoader to load info from
       * @return the created Type
       * @throws Exception if an error occurs
       */
      private Type buildFromXMLDescriptor( final String classname,
                                                    final ClassLoader classLoader )
          throws Exception
      {
          final String xinfo =
              classname.replace( '.', '/' ) + ".xinfo";
          final InputStream inputStream =
              classLoader.getResourceAsStream( xinfo );
          if( null == inputStream )
          {
              final String message =
                  REZ.getString( "builder.missing-info.error",
                                 classname );
              throw new Exception( message );
          }
  
          final TypeCreator xmlTypeCreator = getXMLTypeCreator( classname );
          return xmlTypeCreator.createType( classname, inputStream );
      }
  
      /**
       * Utility to get xml info builder, else throw
       * an exception if missing descriptor.
       *
       * @return the TypeCreator
       */
      private TypeCreator getXMLTypeCreator( final String classname )
          throws Exception
      {
          if( null != m_xmlTypeCreator )
          {
              return m_xmlTypeCreator;
          }
          else
          {
              final String message =
                  REZ.getString( "builder.missing-xml-creator.error",
                                 classname );
              throw new Exception( message );
          }
      }
  
      /**
       * Utility to get XMLTypeCreator if XML files are on
       * ClassPath.
       *
       * @return the XML {@link TypeCreator}
       */
      private static TypeCreator createXMLTypeCreator()
      {
          TypeCreator xmlTypeCreator = null;
          try
          {
              xmlTypeCreator = new XMLTypeCreator();
          }
          catch( final Exception e )
          {
              //Ignore it if ClassNot found due to no
              //XML Classes on classpath
          }
          return xmlTypeCreator;
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info/builder/TypeCreator.java
  
  Index: TypeCreator.java
  ===================================================================
  /*
   * 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.meta.info.builder;
  
  import org.apache.excalibur.meta.info.Type;
  import java.io.InputStream;
  
  /**
   * Simple interface used to create {@link Type}
   * from stream. This abstraction was primarily created so
   * that the Type could be built from non-XML
   * sources and no XML classes need be in the classpath.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Donald</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2002/07/12 15:11:58 $
   */
  public interface TypeCreator
  {
      /**
       * Create a {@link Type} from stream
       *
       * @param key the name of component type that we are looking up
       * @param inputStream the stream that the resource is loaded from
       * @return the newly created {@link Type}
       * @throws Exception
       */
      Type createType( String key, InputStream inputStream )
          throws Exception;
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/info/builder/XMLTypeCreator.java
  
  Index: XMLTypeCreator.java
  ===================================================================
  /*
   * 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.meta.info.builder;
  
  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.Version;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.excalibur.meta.info.ComponentDescriptor;
  import org.apache.excalibur.meta.info.Type;
  import org.apache.excalibur.meta.info.DefaultType;
  import org.apache.excalibur.meta.info.ContextDescriptor;
  import org.apache.excalibur.meta.info.DependencyDescriptor;
  import org.apache.excalibur.meta.info.EntryDescriptor;
  import org.apache.excalibur.meta.info.LoggerDescriptor;
  import org.apache.excalibur.meta.info.ServiceDescriptor;
  import org.apache.excalibur.meta.info.ServiceDesignator;
  import org.apache.excalibur.meta.ConfigurationBuilder;
  import org.xml.sax.InputSource;
  
  /**
   * Handles internalization of an XML based description of a {@link Type}
   * from a Configuration object. The format for Configuration object
   * is specified in the <a href="package-summary.html#external">package summary</a>.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Donald</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2002/07/12 15:11:58 $
   */
  public final class XMLTypeCreator
      extends AbstractLogEnabled
      implements TypeCreator
  {
      private static final Resources REZ =
          ResourceManager.getPackageResources( XMLTypeCreator.class );
  
      /**
       * Create a {@link Type} object for specified
       * classname, loaded from specified {@link InputStream}.
       *
       * @param implementationKey The classname of Component
       * @param inputStream the InputStream to load Type from
       * @return the created Type
       * @throws Exception if an error occurs
       */
      public Type createType( String implementationKey,
                                                InputStream inputStream )
          throws Exception
      {
          if( inputStream == null ) 
            throw new NullPointerException("input stream.");
  
          final InputSource input = new InputSource( inputStream );
          final String classname = implementationKey;
          final Configuration configuration = ConfigurationBuilder.build( input );
          return build( classname, configuration );
      }
  
      /**
       * Create a {@link Type} object for specified classname from
       * specified configuration data.
       *
       * @param classname The classname of Component
       * @param info the Type configuration
       * @return the created Type
       * @throws ConfigurationException if an error occurs
       */
      private Type build( final String classname,
                                   final Configuration info )
          throws Exception
      {
          if( getLogger().isDebugEnabled() )
          {
              final String message =
                  REZ.getString( "builder.creating-info.notice",
                                 classname );
              getLogger().debug( message );
          }
  
          final String topLevelName = info.getName();
          if( !topLevelName.equals( "component-info" ) )
          {
              final String message =
                  REZ.getString( "builder.bad-toplevel-element.error",
                                 classname,
                                 topLevelName );
              throw new ConfigurationException( message );
          }
  
          Configuration configuration = null;
  
          configuration = info.getChild( "loggers" );
          final LoggerDescriptor[] loggers = buildLoggers( configuration );
  
          configuration = info.getChild( "context" );
          final ContextDescriptor context = buildContext( configuration );
  
          configuration = info.getChild( "services" );
          final ServiceDescriptor[] services = buildServices( configuration );
  
          configuration = info.getChild( "dependencies" );
          final DependencyDescriptor[] dependencies = buildDependencies( classname, 
configuration );
  
          configuration = info.getChild( "component" );
          final ComponentDescriptor descriptor =
              buildComponentDescriptor( classname, configuration );
  
          if( getLogger().isDebugEnabled() )
          {
              final String message =
                  REZ.getString( "builder.created-info.notice",
                                 classname,
                                 new Integer( services.length ),
                                 new Integer( dependencies.length ),
                                 new Integer( context.getEntrys().length ),
                                 new Integer( loggers.length ) );
              getLogger().debug( message );
          }
  
          return new DefaultType( descriptor, loggers, context, services, dependencies 
);
      }
  
      /**
       * A utility method to build an array of {@link LoggerDescriptor} objects
       * from specified configuraiton.
       *
       * @param configuration the loggers configuration
       * @return the created LoggerDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private LoggerDescriptor[] buildLoggers( final Configuration configuration )
          throws ConfigurationException
      {
          final Configuration[] elements = configuration.getChildren( "logger" );
          final ArrayList loggers = new ArrayList();
  
          for( int i = 0; i < elements.length; i++ )
          {
              final LoggerDescriptor logger = buildLogger( elements[ i ] );
              loggers.add( logger );
          }
  
          return (LoggerDescriptor[])loggers.toArray( new LoggerDescriptor[ 
loggers.size() ] );
      }
  
      /**
       * A utility method to build a {@link LoggerDescriptor}
       * object from specified configuraiton.
       *
       * @param logger the Logger configuration
       * @return the created LoggerDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private LoggerDescriptor buildLogger( Configuration logger )
          throws ConfigurationException
      {
          final Properties attributes = buildAttributes( logger.getChild( "attributes" 
) );
          final String name = logger.getAttribute( "name", "" );
          return new LoggerDescriptor( name, attributes );
      }
  
      /**
       * A utility method to build an array of {@link DependencyDescriptor}
       * objects from specified configuration and classname.
       *
       * @param classname The classname of Component (used for logging purposes)
       * @param configuration the dependencies configuration
       * @return the created DependencyDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private DependencyDescriptor[] buildDependencies( final String classname,
                                                        final Configuration 
configuration )
          throws ConfigurationException
      {
          final Configuration[] elements = configuration.getChildren( "dependency" );
          final ArrayList dependencies = new ArrayList();
  
          for( int i = 0; i < elements.length; i++ )
          {
              final DependencyDescriptor dependency =
                  buildDependency( classname, elements[ i ] );
              dependencies.add( dependency );
          }
  
          return (DependencyDescriptor[])dependencies.toArray( new 
DependencyDescriptor[ 0 ] );
      }
  
      /**
       * A utility method to build a {@link DependencyDescriptor}
       * object from specified configuraiton.
       *
       * @param classname The classname of Component (used for logging purposes)
       * @param dependency the dependency configuration
       * @return the created DependencyDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private DependencyDescriptor buildDependency( final String classname,
                                                    final Configuration dependency )
          throws ConfigurationException
      {
          final ServiceDesignator service =
              buildServiceDesignator( dependency.getChild( "service-ref" ) );
          final boolean optional =
              dependency.getAttributeAsBoolean( "optional", false );
  
          final Properties attributes =
              buildAttributes( dependency.getChild( "attributes" ) );
  
          String role = dependency.getChild( "role" ).getValue( null );
  
          //default to name of service if role unspecified
          if( null == role )
          {
              role = service.getClassname();
          }
          else
          {
              //If role is specified and it is the same as
              //service name then warn that it is redundent.
              if( role.equals( service.getClassname() ) )
              {
                  final String message =
                      REZ.getString( "builder.redundent-role.notice",
                                     classname,
                                     role );
                  getLogger().warn( message );
              }
          }
  
          return new DependencyDescriptor( role, service, optional, attributes );
      }
  
      /**
       * A utility method to build a {@link ContextDescriptor}
       * object from specified configuraiton.
       *
       * @param context the dependency configuration
       * @return the created ContextDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ContextDescriptor buildContext( final Configuration context )
          throws ConfigurationException
      {
          final EntryDescriptor[] entrys =
              buildEntrys( context.getChildren( "entry" ) );
  
          final Properties attributes =
              buildAttributes( context.getChild( "attributes" ) );
  
          final String type =
              context.getAttribute( "type",
                                    Context.class.getName() );
  
          return new ContextDescriptor( type, entrys, attributes );
      }
  
      /**
       * A utility method to build an array of {@link EntryDescriptor}
       * objects from specified configuraiton.
       *
       * @param entrySet the set of entrys to build
       * @return the created {@link EntryDescriptor}s
       * @throws ConfigurationException if an error occurs
       */
      private EntryDescriptor[] buildEntrys( final Configuration[] entrySet )
          throws ConfigurationException
      {
          final ArrayList entrys = new ArrayList();
  
          for( int i = 0; i < entrySet.length; i++ )
          {
              final EntryDescriptor service = buildEntry( entrySet[ i ] );
              entrys.add( service );
          }
  
          return (EntryDescriptor[])entrys.toArray( new EntryDescriptor[ entrys.size() 
] );
      }
  
      /**
       * Create a {@link EntryDescriptor} from configuration.
       *
       * @param config the configuration
       * @return the created {@link EntryDescriptor}
       * @throws ConfigurationException if an error occurs
       */
      private EntryDescriptor buildEntry( final Configuration config )
          throws ConfigurationException
      {
          final String key = config.getAttribute( "key" );
          final String type = config.getAttribute( "type" );
          final boolean optional =
              config.getAttributeAsBoolean( "optional", false );
  
          return new EntryDescriptor( key, type, optional );
      }
  
      /**
       * A utility method to build an array of {@link ServiceDescriptor}
       * objects from specified configuraiton.
       *
       * @param servicesSet the services configuration
       * @return the created ServiceDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ServiceDescriptor[] buildServices( final Configuration servicesSet )
          throws ConfigurationException
      {
          final Configuration[] elements = servicesSet.getChildren( "service" );
          final ArrayList services = new ArrayList();
  
          for( int i = 0; i < elements.length; i++ )
          {
              final ServiceDescriptor service = buildService( elements[ i ] );
              services.add( service );
          }
  
          return (ServiceDescriptor[])services.toArray( new ServiceDescriptor[ 0 ] );
      }
  
      /**
       * A utility method to build a {@link ServiceDesignator}
       * object from specified configuraiton data.
       *
       * @param service the service Configuration
       * @return the created ServiceDesignator
       * @throws ConfigurationException if an error occurs
       */
      private ServiceDesignator buildServiceDesignator( final Configuration service )
          throws ConfigurationException
      {
          final String name = service.getAttribute( "type" );
          final String versionString = service.getAttribute( "version", "1.0" );
          final Version version = buildVersion( versionString );
          return new ServiceDesignator( name, version );
      }
  
      /**
       * A utility method to build a <code>ServiceDescriptor</code>
       * object from specified configuraiton data.
       *
       * @param service the service Configuration
       * @return the created ServiceDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ServiceDescriptor buildService( final Configuration service )
          throws ConfigurationException
      {
          final Configuration serviceRef = service.getChild( "service-ref" );
          final ServiceDesignator designator = buildServiceDesignator( serviceRef );
          final Properties attributes =
              buildAttributes( service.getChild( "attributes" ) );
          return new ServiceDescriptor( designator, attributes );
      }
  
      /**
       * Build up a list of attributes from specific config tree.
       *
       * @param config the attributes config
       * @return the Properties object representing attributes
       */
      private Properties buildAttributes( final Configuration config )
          throws ConfigurationException
      {
          final Properties attributes = new Properties();
          final Configuration[] children = config.getChildren( "attribute" );
          for( int i = 0; i < children.length; i++ )
          {
              Configuration child = children[ i ];
              final String key = child.getAttribute( "key" );
              final String value = child.getAttribute( "value" );
              attributes.setProperty( key, value );
          }
          return attributes;
      }
  
      /**
       * A utility method to build a {@link ComponentDescriptor}
       * object from specified configuraiton data and classname.
       *
       * @param classname The classname of Component (used to create descriptor)
       * @param component the Component Configuration
       * @return the created ComponentDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ComponentDescriptor buildComponentDescriptor( final String classname,
                                                            final Configuration 
component )
          throws ConfigurationException
      {
          final String name = component.getChild( "name" ).getValue( null );
          final Version version = buildVersion( component.getChild( "version" 
).getValue( "1.0" ) );
          final Properties attributes =
              buildAttributes( component.getChild( "attributes" ) );
  
          return new ComponentDescriptor( name, classname, version, attributes );
      }
  
      /**
       * A utility method to parse a Version object from specified string.
       *
       * @param version the version string
       * @return the created Version object
       */
      private Version buildVersion( final String version )
      {
          return Version.getVersion( version );
      }
  }
  
  
  
  1.3       +0 -23     
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/verifier/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/verifier/Resources.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Resources.properties      7 Jul 2002 04:28:31 -0000       1.2
  +++ Resources.properties      12 Jul 2002 15:11:58 -0000      1.3
  @@ -11,26 +11,3 @@
   verifier.incompat-serviceable.error=The implementation class {1} for component 
named "{0}" is both Serviceable and Composable (incompatible lifecycle interfaces).
   verifier.incompat-config.error=The implementation class {1} for component named 
"{0}" is both Configurable and Parameterizable (incompatible lifecycle interfaces).
   verifier.noimpl-service.error=The implementation class {1} for component named 
"{0}" does not implement the service interface {2} which it declares it supports.
  -
  -#Assembly Verifier
  -assembly.valid-names.notice=Verifying that the names specified for Component are 
valid.
  -assembly.unique-names.notice=Verifying that the names specified for the Components 
are unique.
  -assembly.dependencies-mapping.notice=Verifying that the dependency mapping is valid 
according to ComponentInfos.
  -assembly.dependency-references.notice=Verifying that the dependency mapping for 
every Component is valid with respect to other components.
  -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.dependency-missing-service.error=Profile {0}" is associated to profile 
"{1}" under the role "{2}" however, the provider does not supply the required service 
"{3}".
  -
  -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}".
  -
  -#MetaData Verifier
  -metadata.bad-service-class.error=Unable to load service class "{1}" for Component 
named "{0}". (Reason: {2}).
  -metadata.nodeclare-deps.error=Component named "{0}" of type "{1}" is Composable or 
Serviceable but does not declare any dependencies.
  -metadata.declare-uneeded-deps.error=Component named "{0}" of type "{1}" is not 
Composable or Serviceable but declares dependencies.
  -metadata.declare-uneeded-entrys.error=Component named "{0}" of type "{1}" is not 
Contextualizable but declares Context Entrys.
  \ No newline at end of file
  
  
  
  1.3       +4 -8      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/verifier/package.html
  
  Index: package.html
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/verifier/package.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- package.html      7 Jul 2002 04:28:31 -0000       1.2
  +++ package.html      12 Jul 2002 15:11:58 -0000      1.3
  @@ -1,17 +1,13 @@
   
   <body>
  -A set of classes supporting verification of components and component
  -assemblies using class and component meta-data information.
  +A set of classes supporting verification of components types using class and 
component meta information.
   
   <h3>Overview</h3>
   <p>This package includes a set of classes supporting the verification of the
   integrity of a component class and the verification of the integrity of a
  -relationships and inter-dependecies based on supplied meta-data. The
  -{@link org.apache.excalibur.meta.verifier.ComponentVerifier} provides
  +relationships and inter-dependecies based on supplied meta info. The
  +{@link org.apache.excalibur.meta.info.verifier.ComponentVerifier} provides
   support for the validation of a component class.  It includes validation
   functions that check for structural and best-practice integrity related to
  -the class, lifecycle patterns and service. The
  -{@link org.apache.excalibur.meta.verifier.AssemblyVerifier} performs
  -validation of the structural integrity of a set component assembly based on
  -assembly meta-data.
  +the class, lifecycle patterns and service.
   </body>
  
  
  

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

Reply via email to