You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/07/26 08:17:05 UTC

cvs commit: jakarta-avalon-excalibur/assembly/src/xdocs logging.xml

mcconnell    2002/07/25 23:17:05

  Modified:    assembly/src/java/org/apache/excalibur/merlin
                        DefaultController.java
               assembly/src/java/org/apache/excalibur/merlin/container
                        DefaultContainer.java ProfileRegistry.java
               assembly/src/java/org/apache/excalibur/merlin/container/doc-files
                        DefaultContainer.gif
               assembly/src/java/org/apache/excalibur/merlin/doc-files
                        DefaultController.gif
               assembly/src/java/org/apache/excalibur/merlin/kernel
                        DefaultKernel.java
               assembly/src/java/org/apache/excalibur/merlin/model
                        Category.java ContainerDescriptor.java
                        KernelDescriptor.java Parent.java Profile.java
               assembly/src/xdocs logging.xml
  Log:
  Javadoc and minor cleaning up.
  
  Revision  Changes    Path
  1.7       +9 -7      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/DefaultController.java
  
  Index: DefaultController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/DefaultController.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultController.java	25 Jul 2002 18:07:15 -0000	1.6
  +++ DefaultController.java	26 Jul 2002 06:17:04 -0000	1.7
  @@ -55,23 +55,25 @@
    *     // create the execution context
    *     //</font>
    *
  - *     File file = new File( <font color="darkred"/>&quot;src/etc/kernel.xml&quot;</font> );
  + *     File <strong>file</strong> = new File( <font color="darkred"/>&quot;src/etc/kernel.xml&quot;</font> );
    *     DefaultContext <strong>context</strong> = new DefaultContext();
  - *     context.put( DefaultController.CONTROLLER_PATH_KEY, file );
  - *     context.makeReadOnly();
  + *     <strong>context</strong>.put( DefaultController.CONTROLLER_PATH_KEY, <strong>file</strong> );
  + *     <strong>context</strong>.makeReadOnly();
    *     
    *     <font color="gray">//
    *     // deploy the kernel
    *     //</font>
    *
    *     DefaultController <strong>controller</strong> = new DefaultController();
  - *     controller.contextualize( context );
  - *     controller.initialize();
  - *     controller.start(); 
  + *     <strong>controller</strong>.contextualize( <strong>context</strong> );
  + *     <strong>controller</strong>.initialize();
  + *     <strong>controller</strong>.start(); 
    * 
    * </pre>
    *
    * @see Main
  + * @see DefaultKernel
  + * @see Controller
    * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
    * @version $Revision$ $Date$
    */
  
  
  
  1.16      +69 -29    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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DefaultContainer.java	25 Jul 2002 18:07:15 -0000	1.15
  +++ DefaultContainer.java	26 Jul 2002 06:17:04 -0000	1.16
  @@ -98,32 +98,23 @@
       //=======================================================================
   
      /**
  -    * Context key used to locate the application classloader.
  -    */
  -    public static final String CLASSLOADER_KEY = "classloader";
  -
  -   /**
  -    * Context key used to locate the application classloader.
  +    * Context key used to locate the parent container.
       */
       public static final String CONTAINER_KEY = "container";
   
      /**
  -    * Context key used to locate the application classloader.
  +    * Context key used to locate the shared dependency map.
       */
       public static final String MAP_KEY = "map";
   
      /**
  -    * Context key used to locate the logger manager.
  -    */
  -    public static final String LOG_MANAGER_KEY = "logging";
  -
  -   /**
  -    * Context key used to locate the logger manager.
  +    * Context key used to locate the container meta data model.
       */
       public static final String CONTAINER_DESCRIPTOR_KEY = "descriptor";
   
      /**
  -    * Context key used to locate the logger manager.
  +    * Context key used to locate the kernel supplied disctionary of context
  +    * entries available for import.
       */
       public static final String DICTIONARY_KEY = "dictionary";
   
  @@ -145,18 +136,30 @@
       */
       private Container m_parent;
   
  +   /**
  +    * The classloader resolved from the meta model.
  +    */
       private TypeManager m_classloader;
   
  +   /**
  +    * Dependecy graph shared across all containers within the container hierachy.
  +    */
       private DependencyGraph m_map;
   
  +   /**
  +    * Utility class providing support for establishments of objects that get 
  +    * supplied to components (cofiguration, context, etc.). Interacts between 
  +    * the meta model, container implementation, resources and service managers.
  +    */
       private ResourceProvider m_provider;
   
  -    //private DefaultLoggerManager m_logging;
  -
  +   /**
  +    * The meta data model of this container.
  +    */
       private ContainerDescriptor m_descriptor;
   
      /**
  -    * The lifecycle helper to use to process startup and shudown of services.
  +    * The lifecycle helper to use to process startup and shutdown of services.
       */
       private LifecycleHelper m_helper = new LifecycleHelper();
   
  @@ -166,10 +169,20 @@
       */
       private ProfileRegistry m_profiles; 
   
  +   /**
  +    * Table of resources that have been created - keyed by the associated profile.
  +    */
       private Hashtable m_mapping = new Hashtable();
   
  +   /**
  +    * Utility class used to create type meta info for compoents not explicity declared 
  +    * in the meta data model.
  +    */
       private ProfileBuilder m_builder = new ProfileBuilder();
   
  +   /**
  +    * Flag showing initialization status.
  +    */
       private boolean m_initialized = false;
   
      /**
  @@ -182,12 +195,22 @@
       //=======================================================================
   
      /**
  -    * Service context from which the registry classloader is resolved.
  -    * @param context a context value containing the key 'classloader' 
  +    * <p>Service context from which the container meta data model is provided.</p>
  +    * <ul>
  +    *  <li>{@link #CONTAINER_DESCRIPTOR_KEY} the container meta model as 
  +    *         a {@link ContainerDescriptor} (REQUIRED}</li>
  +    *  <li>{@link #DICTIONARY_KEY} the kernel context import dictionary as 
  +    *         a {@link Context} object from which import directives may be resolved
  +    *         (REQUIRED)</li>
  +    *  <li>{@link #CONTAINER_KEY} the parent {@link Container} (OPTIONAL) - if null,
  +    *         this is a root container </li>
  +    *  <li>{@link #MAP_KEY} the shared dependecy map {@link DependencyGraph} (OPTIONAL) 
  +    *         - if null, this is a root container</li>
  +    * </ul>
  +    * @param context the service context value 
       */
       public void contextualize( Context context ) throws ContextException
       {
  -        //m_logging = (DefaultLoggerManager) context.get( LOG_MANAGER_KEY );
           m_descriptor = (ContainerDescriptor) context.get( CONTAINER_DESCRIPTOR_KEY );
           m_dictionary = (Context) context.get( DICTIONARY_KEY );
           m_classloader = m_descriptor.getTypeManager();
  @@ -210,9 +233,8 @@
   
      /**
       * Initalization of a <code>Container</code>.  Initilization of types and
  -    * associated provides (inplicit, explicit and packaged) is undertaken by the 
  -    * (@link Registry} supertype.  Following the registry initialization of the 
  -    * containers primary propulation the container initialization continues through
  +    * associated provides (inplicit, explicit and packaged) is undertaken 
  +    * following which primary propulation the container's components preceeds
       * the establishment of subsidiary containers.
       *
       * @exception Exception if an error occurs during initialization.
  @@ -223,7 +245,6 @@
           getLogger().debug( "container creation using clasloader: " + m_classloader );
   
           m_helper.enableLogging( getLogger().getChildLogger("lifecycle") );
  -        //m_provider = new ResourceProvider( m_classloader, m_logging, this, m_dictionary );
           m_provider = new ResourceProvider( m_classloader, this, m_dictionary );
           m_provider.enableLogging( getLogger().getChildLogger("provider") );
   
  @@ -232,8 +253,15 @@
           //
   
           m_profiles = new ProfileRegistry( 
  -          m_descriptor, m_classloader, getPath(), m_parent, m_map, m_helper, m_provider, 
  +          m_descriptor, 
  +          m_classloader, 
  +          getPath(), 
  +          m_parent, 
  +          m_map, 
  +          m_helper, 
  +          m_provider, 
             m_mapping );
  +
           m_profiles.enableLogging( getLogger().getChildLogger( "assembly") );
   
           // 
  @@ -322,6 +350,12 @@
       // Startable
       //======================================================================
   
  +   /**
  +    * Method invoked by the container's container to signal the activation of 
  +    * all components.
  +    * 
  +    * @exception Exception if a start related error occurs
  +    */
       public void start() throws Exception
       {
           getLogger().debug("start");
  @@ -358,6 +392,12 @@
           getLogger().debug("started");
       }
   
  +   /**
  +    * Method invoked by the container's container to signal the deactivation of 
  +    * all components.
  +    * 
  +    * @exception Exception if a stop related error occurs
  +    */
       public void stop()
       {
           getLogger().debug("stop");
  @@ -512,8 +552,8 @@
       */
       public String getPath()
       {
  -        if( m_parent == null ) return "/" + m_descriptor.getName();
  -        return m_parent.getPath() + "/" + m_descriptor.getName();
  +        if( m_parent == null ) return ContainerDescriptor.DELIMITER + m_descriptor.getName();
  +        return m_parent.getPath() + ContainerDescriptor.DELIMITER + m_descriptor.getName();
       }
   
      /**
  @@ -619,7 +659,7 @@
       }
   
      /**
  -    * Internal validation.  Propably no longer needed.
  +    * Internal validation.  Probably no longer needed.
       * @param map the dependency map
       */
       private void validateResourceMapping( Map map )
  
  
  
  1.12      +3 -3      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ProfileRegistry.java	20 Jul 2002 05:03:01 -0000	1.11
  +++ ProfileRegistry.java	26 Jul 2002 06:17:04 -0000	1.12
  @@ -176,7 +176,7 @@
               ArrayList visited = new ArrayList();
               assembleProfile( profile, visited, "" );
   
  -            final String name = m_path + "/" + profile.getName();
  +            final String name = m_path + ContainerDescriptor.DELIMITER + profile.getName();
               final ResourceDesignator resource = 
                 new ProfileDesignator( name, profile, m_helper, m_provider );
               m_mapping.put( profile, resource );
  @@ -243,7 +243,7 @@
                        + role + "'.";
                       throw new UnresolvedProviderException( warning, dependency );
                   }
  -                final String path = m_path + "/" + provider.getName();
  +                final String path = m_path + ContainerDescriptor.DELIMITER + provider.getName();
                   ResourceDesignator resource = getCandidateResource( provider );
                   if( resource == null )
                   {
  
  
  
  1.4       +29 -47    jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/doc-files/DefaultContainer.gif
  
  	<<Binary file>>
  
  
  1.2       +19 -18    jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/doc-files/DefaultController.gif
  
  	<<Binary file>>
  
  
  1.22      +80 -8     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- DefaultKernel.java	25 Jul 2002 18:07:15 -0000	1.21
  +++ DefaultKernel.java	26 Jul 2002 06:17:04 -0000	1.22
  @@ -70,24 +70,77 @@
   import org.apache.excalibur.merlin.model.ContainerDescriptor;
   import org.apache.excalibur.merlin.model.builder.TypeManager;
   import org.apache.excalibur.merlin.model.ResourceDesignator;
  +import org.apache.excalibur.merlin.model.builder.XMLKernelCreator;
   import org.apache.excalibur.merlin.container.DefaultContainer;
   
   /**
    * Default kernel implementation.
  + * <p><b>UML</b></p>
  + * <p><image src="doc-files/DefaultKernel.gif" border="0"/></p>
  + * <p><b>Code Example</b></p>
  + * <p>The following code fragment demonstrates the creation and startup of a new 
  + * kernel instance.</P>
  + * <pre>
  +   
  +        <font color="gray">//
  +        // Read in the configuration.
  +        //</font>
  +
  +        File <strong>file</strong> = new File("<font color="darkred"/>kernel.xml</font>");
  +        {@link DefaultConfigurationBuilder} <strong>builder</strong> = new DefaultConfigurationBuilder();
  +        InputStream <strong>input</strong> = new FileInputStream( <strong>file</strong> );
  +        {@link Configuration} <strong>configuration</strong> = <strong>builder</strong>.build( <strong>input</strong> );
  +
  +        <font color="gray">//
  +        // Create the kernel meta model using the configuration and a root classloder.
  +        //</font>
  +
  +        ClassLoader <strong>classloader</strong> = Thread.currentThread().getContextClassLoader();
  +        {@link XMLKernelCreator} <strong>creator</strong> = new XMLKernelCreator();
  +        {@link KernelDescriptor} <strong>descriptor</strong> = <strong>creator</strong>.createKernelDescriptor(
  +           <strong>configuration</strong>, <strong>classloader</strong> );
  +
  +        <font color="gray">//
  +        // Create a kernel implementation.
  +        //</font>
  +
  +        {@link DefaultContext} <strong>context</strong> = new DefaultContext();
  +        <strong>context</strong>.put( DefaultKernel.{@link #KERNEL_DESCRIPTOR_KEY}, <strong>descriptor</strong> );
  +        <strong>context</strong>.makeReadOnly();
  +        DefaultKernel <strong>kernel</strong> = new DefaultKernel();
  +        Logger <strong>logger</strong> = <strong>descriptor</strong>.getLogger();
  +        <strong>kernel</strong>.enableLogging( <strong>logger</strong> );
  +        <strong>kernel</strong>.contextualize( <strong>context</strong> );
  +        <strong>kernel</strong>.initialize();
  +
  +        <font color="gray">//
  +        // Following initialization the assembly of components has been completed and 
  +        // resource descriptiors have been assigned.  Service exported by the kernel may 
  +        // may be access via {@link ResourceDescriptor} references exposed by the 
  +        // {link #getResources()} method.  The following method start all resources 
  +        // declared as activatable on startup.
  +        //</font>
  +
  +        <strong>kernel</strong>.start();
  +
  + * </pre>
  + *
  + * @see XMLKernelCreator
  + * @see KernelDescriptor
  + * @see Kernel
    *
    * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
    * @version $Revision$ $Date$
    */
   public class DefaultKernel extends AbstractLogEnabled 
  -  implements Kernel, Contextualizable, Initializable, Disposable
  +  implements Kernel, Contextualizable, Initializable, Startable, Disposable
   {
       //=======================================================================
       // static
       //=======================================================================
   
  -    public static final String AVALON_WORK_KEY = "avalon:work";
  +    public static final String WORKING_DIRECTORY_KEY = "avalon:work";
       public static final String KERNEL_DESCRIPTOR_KEY = "descriptor";
  -    public static final String LOG_MANAGER_KEY = "logmanager";
   
       //=======================================================================
       // state
  @@ -143,7 +196,7 @@
   
           getLogger().debug("container dictionary" );
           DefaultContext dictionary = new DefaultContext();
  -        dictionary.put( AVALON_WORK_KEY, new File( System.getProperty("user.dir") ) );
  +        dictionary.put( WORKING_DIRECTORY_KEY, new File( System.getProperty("user.dir") ) );
           dictionary.makeReadOnly();
   
           //
  @@ -205,10 +258,14 @@
       }
   
       //=======================================================================
  -    // Controller
  +    // Startable
       //=======================================================================
   
  -    public void startup() throws Exception
  +   /**
  +    * Invoked by a contrainer to requested disposal of the kernel and all
  +    * consumed resources.
  +    */
  +    public void start() throws Exception
       {
           if( !m_initialized ) return;
           //listProfiles();
  @@ -229,13 +286,28 @@
           getLogger().info("startup complete");
       }
   
  -    public void shutdown()
  +
  +    public void stop()
       {
           if( !m_initialized ) return;
           if( getLogger().isInfoEnabled() )
             getLogger().info("shutdown");
           m_container.shutdown();
           getLogger().info("shutdown complete");
  +    }
  +
  +    //=======================================================================
  +    // Controller
  +    //=======================================================================
  +
  +    public void startup() throws Exception
  +    {
  +        start();
  +    }
  +
  +    public void shutdown()
  +    {
  +        stop();
       }
   
       //=======================================================================
  
  
  
  1.2       +3 -3      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Category.java
  
  Index: Category.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Category.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Category.java	25 Jul 2002 18:04:58 -0000	1.1
  +++ Category.java	26 Jul 2002 06:17:04 -0000	1.2
  @@ -20,14 +20,14 @@
    *
    * <p><b>XML</b></p>
    * <pre>
  - *    &lt;loggers priority="<font color="darkred">INFO</font>"&gt;
  + *    &lt;categories priority="<font color="darkred">INFO</font>"&gt;
    *      &lt;category priority="<font color="darkred">DEBUG</font>"  name="<font color="darkred">loader</font>" /&gt;
    *      &lt;category priority="<font color="darkred">WARN</font>"  name="<font color="darkred">types</font>" /&gt;
    *      &lt;category priority="<font color="darkred">ERROR</font>"  name="<font color="darkred">types.builder</font>" target="<font color="darkred">default</font>"/&gt;
    *      &lt;category name="<font color="darkred">profiles</font>" /&gt;
    *      &lt;category name="<font color="darkred">lifecycle</font>" /&gt;
    *      &lt;category name="<font color="darkred">verifier</font>" /&gt;
  - *    &lt;/loggers&gt;
  + *    &lt;/categories&gt;
    * </pre>
    * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
    * @version $Revision$ $Date$
  
  
  
  1.8       +6 -28     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/ContainerDescriptor.java
  
  Index: ContainerDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/ContainerDescriptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContainerDescriptor.java	25 Jul 2002 18:07:16 -0000	1.7
  +++ ContainerDescriptor.java	26 Jul 2002 06:17:04 -0000	1.8
  @@ -49,11 +49,11 @@
    *      containtains values if undefined.
    *      --&gt;</i></font>
    * 
  - *      &lt;loggers priority="<font color="darkred">INFO</font>"&gt;
  + *      &lt;categories priority="<font color="darkred">INFO</font>"&gt;
    *        &lt;category name="<font color="darkred">profiles</font>" /&gt;
    *        &lt;category name="<font color="darkred">lifecycle</font>" /&gt;
    *        &lt;category name="<font color="darkred">verifier</font>" /&gt;
  - *      &lt;/loggers&gt;
  + *      &lt;/categories&gt;
    *
    *      <font color="gray"><i>&lt;!-- 
    *      Multiple component profile declarations.  If a component declares dependecies, 
  @@ -85,12 +85,6 @@
    */
   public class ContainerDescriptor extends Parent
   {
  -
  -    /**
  -     * The container classpath descriptor.
  -     */
  -    private final TypeManager m_manager;
  -
       /**
        * The component described within the scope of the container.
        */
  @@ -116,12 +110,7 @@
                              final DefaultLoggerManager logging,
                              final TypeManager manager )
       {
  -        super( parent, name, logging );
  -
  -        if( manager == null ) 
  -          throw new NullPointerException("manager");
  -
  -        m_manager = manager;
  +        super( parent, manager, name, logging );
       }
   
      /**
  @@ -132,25 +121,15 @@
       {
           if( getParent() instanceof ContainerDescriptor )
           {
  -            return getParent().getPath() + "/" + getName();
  +            return getParent().getPath() + DELIMITER + getName();
           }
           else
           {
  -            return "/" + getName();
  +            return DELIMITER + getName();
           }
       }
   
       /**
  -     * Return the type manager assigned to the container.
  -     *
  -     * @return the {@link TypeManager} for the container.
  -     */
  -    public TypeManager getTypeManager()
  -    {
  -        return m_manager;
  -    }
  -
  -    /**
        * Add a component profile to this container.
        *
        * @param component the component profile to add to the container
  @@ -160,7 +139,6 @@
           if( !m_components.contains( component ) )
           {
               m_components.add( component );
  -            component.setContainer( this );
           }
       }
   
  
  
  
  1.6       +15 -30    jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/KernelDescriptor.java
  
  Index: KernelDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/KernelDescriptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- KernelDescriptor.java	25 Jul 2002 18:07:16 -0000	1.5
  +++ KernelDescriptor.java	26 Jul 2002 06:17:04 -0000	1.6
  @@ -26,20 +26,25 @@
    *    &lt;kernel&gt;
    *
    *      <font color="gray"><i>&lt;!--
  - *      Logging catagory creation directive. 
  + *      Logging targets and defaults. 
    *      --&gt;</i></font>
    * 
    *      &lt;logging priority="<font color="darkred">INFO</font>" target="<font color="darkred">kernel</font>"&gt;
    *        &lt;target name="<font color="darkred">kernel</font>"&gt;
    *          &lt;file location="<font color="darkred">kernel.log</font>" /&gt;
    *        &lt;/target&gt;
  - *        &lt;loggers priority="<font color="darkred">WARN</font>"&gt;
  - *          &lt;category name="<font color="darkred">logging</font>"/&gt;
  - *          &lt;category name="<font color="darkred">loader</font>"/&gt;
  - *          &lt;category name="<font color="darkred">installer</font>"/&gt;
  - *        &lt;/loggers&gt;
    *      &lt;/logging&gt;
    *
  + *      <font color="gray"><i>&lt;!--
  + *      Declaration of loggin categories within the scope of the kernel. 
  + *      --&gt;</i></font>
  + * 
  + *      &lt;categories priority="<font color="darkred">WARN</font>"&gt;
  + *        &lt;category name="<font color="darkred">logging</font>"/&gt;
  + *        &lt;category name="<font color="darkred">loader</font>"/&gt;
  + *        &lt;category name="<font color="darkred">installer</font>"/&gt;
  + *      &lt;/categories&gt;
  + *
    *      <font color="gray"><i>&lt;!-- 
    *      Declaration of the extensions directories.
    *      --&gt;</i></font>
  @@ -72,10 +77,10 @@
    *          &lt;/fileset&gt;
    *        &lt;/classpath&gt;
    *        &lt;component name="<font color="darkred">demo-component</font>" class="<font color="darkred">org.apache.excalibur.playground.BasicComponent</font>"&gt;
  - *          &lt;loggers priority="<font color="darkred">WARN</font>"&gt;
  + *          &lt;categories priority="<font color="darkred">WARN</font>"&gt;
    *            &lt;category name="<font color="darkred">cache</font>"/&gt;
    *            &lt;category name="<font color="darkred">store</font>"/&gt;
  - *          &lt;/loggers&gt;
  + *          &lt;/categories&gt;
    *          &lt;context&gt;
    *            &lt;entry name="<font color="darkred">location</font>" value="<font color="darkred">Paris</font>"/&gt;
    *          &lt;/context&gt;
  @@ -102,11 +107,6 @@
       /**
        * The root container.
        */
  -    private TypeManager m_manager;
  -
  -    /**
  -     * The root container.
  -     */
       private ContainerDescriptor m_container;
   
       /**
  @@ -122,22 +122,7 @@
                              final TypeManager manager )
       {
   
  -        super( null, name, logging );
  -
  -        if( manager == null ) 
  -          throw new NullPointerException("manager");
  -
  -        m_manager = manager;
  -    }
  -
  -    /**
  -     * Return the kernel type manager.
  -     *
  -     * @return the {@link TypeManager } for the kernel.
  -     */
  -    public TypeManager getTypeManager()
  -    {
  -        return m_manager;
  +        super( null, manager, name, logging );
       }
   
       /**
  
  
  
  1.3       +31 -6     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Parent.java
  
  Index: Parent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Parent.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Parent.java	25 Jul 2002 18:07:16 -0000	1.2
  +++ Parent.java	26 Jul 2002 06:17:04 -0000	1.3
  @@ -8,8 +8,9 @@
   package org.apache.excalibur.merlin.model;
   
   import java.io.Serializable;
  -import org.apache.excalibur.merlin.model.builder.DefaultLoggerManager;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.excalibur.merlin.model.builder.DefaultLoggerManager;
  +import org.apache.excalibur.merlin.model.builder.TypeManager;
   
   /**
    * Abstract class for types that can act as logical parents.
  @@ -22,6 +23,17 @@
   public abstract class Parent 
     implements Serializable
   {
  +
  +    /**
  +     * The container classpath descriptor.
  +     */
  +    private final TypeManager m_manager;
  +
  +   /**
  +    * Container path delimiter.
  +    */
  +    public static final String DELIMITER = "/";
  +
       /**
        * The kernel name
        */
  @@ -45,18 +57,31 @@
        * @param name the name of the instance
        * @param categories the logging categories descriptor
        */
  -    public Parent( final Parent parent, final String name, final DefaultLoggerManager logging )
  +    public Parent( 
  +      final Parent parent, TypeManager manager, final String name, final DefaultLoggerManager logging )
       {
           if( name == null )
             throw new NullPointerException("name");
           if( logging == null ) 
             throw new NullPointerException("logging");
  +        if( manager == null ) 
  +          throw new NullPointerException("manager");
   
  +        m_manager = manager;
           m_name = name;
           m_logging = logging;
           m_parent = parent;
       }
   
  +    /**
  +     * Return the type manager assigned to the abstract container.
  +     *
  +     * @return the {@link TypeManager} for the container.
  +     */
  +    public TypeManager getTypeManager()
  +    {
  +        return m_manager;
  +    }
   
       /**
        * Return the instance name.
  @@ -76,11 +101,11 @@
       {
           if( getParent() == null )
           {
  -            return "/" + getName();
  +            return DELIMITER + getName();
           }
           else
           {
  -            return getParent().getPath() + "/" + getName();
  +            return getParent().getPath() + DELIMITER + getName();
           }
       }
   
  @@ -123,7 +148,7 @@
        * Add a set of categories to the logging system as direct sub-categrories
        * of the category representing this container.
        *
  -     * @parem categories {@link CategoriesDescriptor} set
  +     * @param categories {@link CategoriesDescriptor} set
        */
       public void addCategories( CategoriesDescriptor categories )
       {
  
  
  
  1.10      +9 -41     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Profile.java
  
  Index: Profile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/model/Profile.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Profile.java	25 Jul 2002 18:07:16 -0000	1.9
  +++ Profile.java	26 Jul 2002 06:17:04 -0000	1.10
  @@ -42,9 +42,13 @@
   
        &lt;component name="<font color="darkred">complex</font>" class="<font color="darkred">org.apache.excalibur.playground.ComplexComponent</font>" activation="<font color="darkred">startup</font>"&gt;
   
  -        &lt;loggers priority="<font color="darkred">DEBUG</font>"&gt;
  +        <font color="gray"><i>&lt;!--
  +        Priority and target assignments for component specific logging categrories.
  +        --&gt;</i></font>
  +
  +        &lt;categories priority="<font color="darkred">DEBUG</font>"&gt;
             &lt;category name="<font color="darkred">init</font>" priority="<font color="darkred">DEBUG</font>" /&gt;
  -        &lt;/loggers&gt;
  +        &lt;/categories&gt;
   
           <font color="gray"><i>&lt;!--
           Include the following context value in the context supplied a component using this 
  @@ -104,11 +108,6 @@
        public static final int EXPLICIT = 2;
   
       /**
  -     * The container container.
  -     */
  -    private ContainerDescriptor m_container;
  -
  -    /**
        * The name of the component profile. This is an
        * abstract name used during assembly.
        */
  @@ -160,7 +159,6 @@
        */
       private final boolean m_activation;
   
  -
       /**
        * Create a Profile instance.
        *
  @@ -168,6 +166,7 @@
        * @param parameters the parameters instance to use during type instantiation
        * @param configuration the configuration instance to use during type instantiation
        * @param context the context instance to use during type instantiation
  +     * @param logger the root logger to be used by an instance established from the profile
        * @param type the type of component that this profile qualifies
        * @param enabled the enabled state of the component profile
        * @param activation TRUE if activation on startup, FALSE to activate on request 
  @@ -207,27 +206,6 @@
           m_mode = mode;
       }
   
  -   /**
  -    * Return the container that this profile is container within.
  -    *
  -    * @return the parent {@link ContainerDescriptor }
  -    */
  -    public ContainerDescriptor getContainer()
  -    {
  -        return m_container;
  -    }
  -
  -   /**
  -    * Set the container containing this profile.
  -    *
  -    * @parent the container descriptor containing this profile
  -    */
  -    public void setContainer( ContainerDescriptor container )
  -    {
  -        m_container = container;
  -    }
  -
  -
       /**
        * Test is this profile is enabled.  A profile is enabled unless explicitly disabled by an
        * assembly directive, or implicity disabled as a result of an assembly failure.
  @@ -269,18 +247,8 @@
           return m_logger;
       }
   
  -
  -   /**
  -    * Returns the path name of this container descriptor.
  -    * @return the container's path
  -    */
  -    public String getPath()
  -    {
  -        return m_container.getPath() + "/" + getName();
  -    }
  -
       /**
  -     * Return the info for component.
  +     * Return the type info for component.
        *
        * @return the info for component type.
        */
  
  
  
  1.2       +10 -8     jakarta-avalon-excalibur/assembly/src/xdocs/logging.xml
  
  Index: logging.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/xdocs/logging.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- logging.xml	21 Jul 2002 05:04:10 -0000	1.1
  +++ logging.xml	26 Jul 2002 06:17:04 -0000	1.2
  @@ -34,19 +34,21 @@
         &lt;target name="<font color="darkred">kernel</font>"&gt;
           &lt;file location="<font color="darkred">kernel.log</font>" /&gt;
         &lt;/target&gt;
  +
  +    &lt;/logging&gt;
   </pre>
   
       <p><font color="gray"><i>&lt;!-- 
       Multiple categories may be declared - each category defines a priority and target
       to be used for the respective caegory.  Category names are scoped relative to the 
       container.  In this context the container is the kernel.  As such a category name
  -    of "logging" translates to a full loggin category path of "kernel.logging".  The 
  +    of "logging" translates to a full logging category path of "kernel.logging".  The 
       logging element may contain priority and target attribute values.  These values
       will overide the system wide defaults relative to kernel sub-categories.
       --&gt;</i></font></p>
   
   <pre>
  -      &lt;loggers priority="<font color="darkred">INFO</font>"&gt;
  +    &lt;categories priority="<font color="darkred">INFO</font>"&gt;
           &lt;category name="<font color="darkred">logging</font>" priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">installer</font>" priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">installer.type</font>"  priority="<font color="darkred">WARN</font>"/&gt;
  @@ -55,7 +57,7 @@
           &lt;category name="<font color="darkred">loader.type</font>"  priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">loader.type.builder</font>"  priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">export</font>"  priority="<font color="darkred">WARN</font>"/&gt;
  -      &lt;/loggers&gt;
  +    &lt;/categories&gt;
   </pre>
   
       <p><font color="gray"><i>&lt;!-- 
  @@ -107,7 +109,7 @@
       </p>
   
   <pre>
  -      &lt;loggers priority="<font color="darkred">INFO</font>"&gt;
  +      &lt;categories priority="<font color="darkred">INFO</font>"&gt;
           &lt;category name="<font color="darkred">loader</font>" priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">loader.type</font>"  priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">loader.type.builder</font>"  priority="<font color="darkred">WARN</font>"/&gt;
  @@ -115,7 +117,7 @@
           &lt;category name="<font color="darkred">assembly.selector</font>"  priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">provider</font>"  priority="<font color="darkred">WARN</font>"/&gt;
           &lt;category name="<font color="darkred">lifecycle</font>"  priority="<font color="darkred">WARN</font>"/&gt;
  -      &lt;/loggers&gt;
  +      &lt;/categories&gt;
   </pre>
   
       <p><font color="gray"><i>&lt;!-- 
  @@ -149,9 +151,9 @@
       </p>
   
   <pre>
  -       &lt;loggers priority="<font color="darkred">DEBUG</font>"&gt;
  +       &lt;categories priority="<font color="darkred">DEBUG</font>"&gt;
            &lt;category name="<font color="darkred">init</font>" priority="<font color="darkred">WARN</font>"/&gt;
  -       &lt;/loggers&gt;
  +       &lt;/categories&gt;
        &lt;/component&gt;
   </pre>
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>