avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/assembly/src/test/org/apache/avalon/playground BasicComponent.xprofile BasicService.xservice DemoManager.xinfo SimpleComponent.xinfo
Date Tue, 03 Dec 2002 06:57:27 GMT
mcconnell    2002/12/02 22:57:27

  Modified:    assembly build.xml
               assembly/src/java/org/apache/avalon/assembly/appliance
                        Appliance.java ApplianceManager.java
                        ApplianceSelector.java DefaultAppliance.java
                        DefaultApplianceManager.java
                        DefaultApplianceSelector.java
                        DefaultAssemblyService.java
               assembly/src/java/org/apache/avalon/assembly/engine
                        DefaultEngine.java
               assembly/src/java/org/apache/avalon/assembly/lifecycle
                        ContextHandler.java DefaultDeploymentService.java
                        DeploymentService.java
               assembly/src/java/org/apache/avalon/assembly/lifecycle/logging
                        DefaultLoggingService.java LoggingService.java
               assembly/src/java/org/apache/avalon/assembly/lifestyle
                        AbstractLifestyleHandler.java
                        DefaultLifestyleService.java LifestyleService.java
                        PooledLifestyleHandler.java
               assembly/src/java/org/apache/avalon/assembly/logging
                        DefaultLoggingManager.java
               assembly/src/java/org/apache/avalon/assembly/profile
                        DefaultProfileManager.java ProfileSelector.java
               assembly/src/java/org/apache/avalon/assembly/service
                        DefaultServiceManager.java
               assembly/src/java/org/apache/avalon/assembly/type
                        DefaultTypeManager.java
               assembly/src/test/org/apache/avalon/assembly
                        TestCaseBase.java
               assembly/src/test/org/apache/avalon/assembly/engine
                        EngineTestCase.java
               assembly/src/test/org/apache/avalon/assembly/profile
                        ProfileManagerTestCase.java
               assembly/src/test/org/apache/avalon/assembly/service
                        DefaultServiceManagerTestCase.java
               assembly/src/test/org/apache/avalon/assembly/type
                        TypeManagerTestCase.java
               assembly/src/test/org/apache/avalon/playground
                        BasicComponent.xprofile BasicService.xservice
                        DemoManager.xinfo SimpleComponent.xinfo
  Added:       assembly/src/java/org/apache/avalon/assembly/logging
                        Resources.properties
  Log:
  Lots of updates - enahancements (even things like optimization of the
  context/service seperation), etc. Still a work in progress.
  
  Revision  Changes    Path
  1.4       +2 -2      avalon-sandbox/assembly/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.xml	1 Dec 2002 06:43:22 -0000	1.3
  +++ build.xml	3 Dec 2002 06:57:25 -0000	1.4
  @@ -382,8 +382,8 @@
   
     <target name="patch">
       <replace dir="src" summary="true"
  -       token="Apache Avalon Project"
  -       value="Apache Avalon Project" >
  +       token="xxxx"
  +       value="yyyy" >
        <include name="**/*.*"/>
       </replace>
     </target>
  
  
  
  1.4       +6 -1      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/Appliance.java
  
  Index: Appliance.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/Appliance.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Appliance.java	1 Dec 2002 06:43:22 -0000	1.3
  +++ Appliance.java	3 Dec 2002 06:57:25 -0000	1.4
  @@ -68,6 +68,11 @@
   
   public interface Appliance
   {
  +   /**
  +    * Release the appliance path.
  +    */
  +    String getPath();
  +
       /**
        * Return the profile backing the appliance.
        * @return the profile that this appliance is managing
  
  
  
  1.4       +2 -1      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/ApplianceManager.java
  
  Index: ApplianceManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/ApplianceManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ApplianceManager.java	29 Nov 2002 13:04:54 -0000	1.3
  +++ ApplianceManager.java	3 Dec 2002 06:57:25 -0000	1.4
  @@ -58,6 +58,7 @@
   import org.apache.avalon.meta.info.DependencyDescriptor;
   import org.apache.avalon.meta.info.StageDescriptor;
   import org.apache.avalon.meta.model.Profile;
  +import org.apache.avalon.assembly.logging.LoggingManager;
   
   /**
    * An appliance manager implemetation provides support for the 
  
  
  
  1.3       +2 -2      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/ApplianceSelector.java
  
  Index: ApplianceSelector.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/ApplianceSelector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ApplianceSelector.java	29 Nov 2002 13:04:54 -0000	1.2
  +++ ApplianceSelector.java	3 Dec 2002 06:57:25 -0000	1.3
  @@ -59,7 +59,7 @@
    * implementing the selector interface may be activated during the selection of
    * candidate service providers during assembly.  A component author may declare a 
    * selection class explicitly via a service dependency attribute with the attribute 
  - * name of <code>avalon:appliance.selector</code>.
  + * name of <code>urn:avalon:appliance.selector</code>.
    *
    * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
  
  
  
  1.5       +33 -23    avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAppliance.java
  
  Index: DefaultAppliance.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAppliance.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultAppliance.java	30 Nov 2002 21:46:39 -0000	1.4
  +++ DefaultAppliance.java	3 Dec 2002 06:57:25 -0000	1.5
  @@ -133,10 +133,10 @@
        */
       private boolean m_initialized = false;
   
  -    /**
  -     * The base logging channel for the componet instance.
  -     */
  -    private Logger m_logger;
  +   /**
  +    * The base path for the appliance.
  +    */
  +    private String m_path;
   
       //==============================================================
       // Contextualizable
  @@ -148,37 +148,37 @@
       * detailed in the following table.</p>
       * <table>
       *   <tr>
  -    *     <td>key</td><td>type</td><td>default</td>
  +    *     <td><strong>key</strong></td><td><strong>type</strong></td><td><strong>default</strong></td>
       *   </tr>
       *   <tr>
  -    *     <td>avalon:classloader</td>
  +    *     <td>urn:avalon:classloader</td>
       *     <td>{@link ClassLoader}</td>
       *     <td>The classloader from to be supplied to the lifestyle manager.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:appliance.profile</td>
  +    *     <td>urn:assembly:appliance.profile</td>
       *     <td>{@link Profile}</td>
       *     <td>The profile backing this appliance.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:appliance.enabled</td>
  +    *     <td>urn:assembly:appliance.enabled</td>
       *     <td>{@link Boolean}</td>
       *     <td>The enabled state of the appliance.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:appliance.activation</td>
  +    *     <td>urn:assembly:appliance.activation</td>
       *     <td>{@link Boolean}</td>
       *     <td>The activation policy for the appliance.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:appliance.context</td>
  +    *     <td>urn:assembly:appliance.context</td>
       *     <td>{@link Context}</td>
       *     <td>Supplimentary (option) deployment context.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:logger</td>
  -    *     <td>{@link org.apache.avalon.framework.logger.Logger}</td>
  -    *     <td>The base client logger from which component loggers will be created.</td> 
  +    *     <td>urn:assembly:appliance.base</td>
  +    *     <td>{@link String}</td>
  +    *     <td>The base path.</td> 
       *   </tr>
       * </table>
       * @param context the runtime context
  @@ -186,12 +186,12 @@
       public void contextualize( Context context ) throws ContextException
       {
           m_context = context;
  -        m_classloader = (ClassLoader) context.get( "assembly:appliance.classloader" );
  -        m_profile = (Profile)context.get( "assembly:appliance.profile" );
  +        m_classloader = (ClassLoader) context.get( "urn:assembly:appliance.classloader" );
  +        m_profile = (Profile)context.get( "urn:assembly:appliance.profile" );
   
           try
           {
  -            m_enabled = ((Boolean)context.get( "assembly:appliance.enabled" )).booleanValue();
  +            m_enabled = ((Boolean)context.get( "urn:assembly:appliance.enabled" )).booleanValue();
           }
           catch( ContextException e )
           {
  @@ -200,22 +200,24 @@
   
           try
           {
  -            m_activation = ((Boolean)context.get( "assembly:appliance.activation" )).booleanValue();
  +            String base = (String) context.get( "urn:assembly:appliance.base" );
  +            m_path = base + "/" + m_profile.getName();
           }
           catch( ContextException e )
           {
  -            m_activation = false;
  +            m_path = "/" + m_profile.getName();
           }
   
           try
           {
  -            m_logger = (Logger) context.get( "assembly:logger" );
  +            m_activation = ((Boolean)context.get( "urn:assembly:appliance.activation" )).booleanValue();
           }
           catch( ContextException e )
           {
  -            m_logger = getLogger();
  +            m_activation = false;
           }
   
  +
       }
   
       //==============================================================
  @@ -229,7 +231,7 @@
       */
       public void service( ServiceManager manager ) throws ServiceException
       {
  -        m_lifestyle = (LifestyleService) manager.lookup( "assembly:lifestyle-service" );
  +        m_lifestyle = (LifestyleService) manager.lookup( "urn:assembly:lifestyle-service" );
       }
   
       //==============================================================
  @@ -257,7 +259,7 @@
   
           try
           {
  -            m_handler = m_lifestyle.createHandler( this, m_classloader, getLogger(), m_logger, m_context );
  +            m_handler = m_lifestyle.createHandler( this, m_classloader, m_context );
           }
           catch( Throwable e )
           {
  @@ -272,6 +274,14 @@
       //=====================================================================
       // implementation
       //=====================================================================
  +
  +   /**
  +    * Release the appliance path.
  +    */
  +    public String getPath()
  +    {
  +        return m_path;
  +    }
   
       /**
        * Return the profile backing the appliance.
  
  
  
  1.4       +106 -65   avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultApplianceManager.java
  
  Index: DefaultApplianceManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultApplianceManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultApplianceManager.java	30 Nov 2002 21:46:39 -0000	1.3
  +++ DefaultApplianceManager.java	3 Dec 2002 06:57:25 -0000	1.4
  @@ -73,6 +73,9 @@
   import org.apache.avalon.meta.model.Profile;
   import org.apache.avalon.assembly.lifestyle.LifestyleService;
   import org.apache.avalon.assembly.lifestyle.DefaultLifestyleService;
  +import org.apache.avalon.assembly.logging.DefaultLoggingManager;
  +import org.apache.avalon.assembly.logging.LoggingManager;
  +import org.apache.avalon.assembly.engine.Engine;
   
   /**
    * The default appliance manager provides support for {@link Appliance}
  @@ -89,7 +92,9 @@
       // static
       //==================================================================
   
  -    public static final String ASSEMBLY_SERVICE_KEY = "assembly:assembly-service";
  +    public static final String ASSEMBLY_SERVICE_KEY = "urn:assembly:assembly-service";
  +
  +    public static final String LOGGING_MANAGER_KEY = "urn:assembly:logging.manager";
   
       //==================================================================
       // state
  @@ -134,49 +139,17 @@
        * The assembly service.
        */
       private AssemblyService m_assembly;
  -
  +    
       /**
  -     * The client logging channel.
  +     * The assembly service.
        */
  -    private Logger m_logger;
  +    private LoggingManager m_logging;
       
  -
  -    //==============================================================
  -    // Serviceable
  -    //==============================================================
  -
  -   /**
  -    * <p>Application of a supporting service to the appliance manager.</p>
  -    * <table>
  -    *   <tr>
  -    *     <td>key</td><td>type</td><td>description</td>
  -    *   </tr>
  -    *   <tr>
  -    *     <td>assembly:lifecycle-service</td>
  -    *     <td>{@link org.apache.avalon.assembly.lifestyle.LifestyleService}</td>
  -    *     <td>The lifestyle service to provide to appliance instances created 
  -    *         by this manager.</td> 
  -    *   </tr>
  -    *   <tr>
  -    *     <td>assembly:assembly-service</td>
  -    *     <td>{@link org.apache.avalon.assembly.AssemblyService}</td>
  -    *     <td>The assembly service.</td> 
  -    *   </tr>
  -    * </table>
  -    * @param context the runtime context
  -    */
  -    public void service( ServiceManager manager ) throws ServiceException
  -    {
  -        m_manager = manager;
  -        try
  -        {
  -            m_assembly = (AssemblyService) manager.lookup( ASSEMBLY_SERVICE_KEY );
  -        }
  -        catch( ServiceException se )
  -        {
  -            m_assembly = bootstrapAssemblyService( manager );
  -        }
  -    }
  +    /**
  +     * The lifestyle service that will be supplied to appliance instances
  +     * created by this manager.
  +     */
  +    private LifestyleService m_lifestyle;
   
       //==============================================================
       // Contextualizable
  @@ -191,20 +164,15 @@
       *     <td>key</td><td>type</td><td>default</td>
       *   </tr>
       *   <tr>
  -    *     <td>assembly:classloader</td>
  +    *     <td>urn:assembly:classloader</td>
       *     <td>java.lang.ClassLoader</td>
       *     <td>The context classloader will be used by default if no value is supplied.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:parent</td>
  +    *     <td>urn:assembly:parent</td>
       *     <td>{@link org.apache.avalon.assembly.appliance.ApplianceManager}</td>
       *     <td>In no value suppled, this appliance manager will be considered as a root manager.</td> 
       *   </tr>
  -    *   <tr>
  -    *     <td>assembly:logger</td>
  -    *     <td>{@link org.apache.avalon.framework.logger.Logger}</td>
  -    *     <td>The base logger from which component loggers will be created.</td> 
  -    *   </tr>
       * </table>
       * @param context the runtime context
       */
  @@ -213,7 +181,7 @@
           m_context = context;
           try
           {
  -            m_parent = (ApplianceManager) context.get( "assembly:parent" );
  +            m_parent = (ApplianceManager) context.get( "urn:assembly:parent" );
           }
           catch( ContextException e )
           {
  @@ -222,23 +190,62 @@
   
           try
           {
  -            m_classloader = (ClassLoader) context.get( "assembly:classloader" );
  +            m_classloader = (ClassLoader) context.get( "urn:assembly:classloader" );
           }
           catch( ContextException e )
           {
               m_classloader = Thread.currentThread().getContextClassLoader();
           }
   
  +        m_contextualized = true;
  +    }
  +
  +    //==============================================================
  +    // Serviceable
  +    //==============================================================
  +
  +   /**
  +    * <p>Application of a supporting service to the appliance manager.</p>
  +    * <table>
  +    *   <tr>
  +    *     <td>key</td><td>type</td><td>description</td>
  +    *   </tr>
  +    *   <tr>
  +    *     <td>urn:assembly:lifecycle-service</td>
  +    *     <td>{@link org.apache.avalon.assembly.lifestyle.LifestyleService}</td>
  +    *     <td>The lifestyle service to provide to appliance instances created 
  +    *         by this manager.</td> 
  +    *   </tr>
  +    *   <tr>
  +    *     <td>urn:assembly:assembly-service</td>
  +    *     <td>{@link org.apache.avalon.assembly.AssemblyService}</td>
  +    *     <td>The assembly service.</td> 
  +    *   </tr>
  +    * </table>
  +    * @param context the runtime context
  +    */
  +    public void service( ServiceManager manager ) throws ServiceException
  +    {
  +        m_manager = manager;
  +        m_logging = (LoggingManager) manager.lookup( LOGGING_MANAGER_KEY );
           try
           {
  -            m_logger = (Logger) context.get( "assembly:logger" );
  +            m_assembly = (AssemblyService) manager.lookup( ASSEMBLY_SERVICE_KEY );
           }
  -        catch( ContextException e )
  +        catch( ServiceException se )
           {
  -            m_logger = getLogger();
  +            m_assembly = bootstrapAssemblyService();
           }
   
  -        m_contextualized = true;
  +        try
  +        {
  +            m_lifestyle = 
  +             (LifestyleService) manager.lookup( "urn:assembly:lifestyle-service" );
  +        }
  +        catch( ServiceException se )
  +        {
  +            // ignore and handle during initialization
  +        }
       }
   
       //==============================================================
  @@ -268,7 +275,19 @@
               throw new IllegalStateException("service");
           }
   
  -        final String key = "assembly:lifestyle-service";
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "initialization" );
  +        }
  +
  +        /*
  +        if( m_lifestyle == null )
  +        {
  +            m_lifestyle = bootstrapLifestyleService();
  +        }
  +        */
  +
  +        final String key = "urn:assembly:lifestyle-service";
           if( !m_manager.hasService( key ) )
           {
               DefaultServiceManager manager = new DefaultServiceManager( m_manager );
  @@ -338,8 +357,14 @@
               throw new NullPointerException( "profile" );
           }
   
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "create: " + profile.getName() );
  +        }
  +
           try
           {
  +            
               DefaultAppliance appliance = new DefaultAppliance();
   
               appliance.enableLogging(
  @@ -354,14 +379,11 @@
               {
                   context = new DefaultContext( map, m_context );
               }
  -
  -            context.put( "assembly:appliance.profile", profile );
  -            context.put( "assembly:appliance.enabled", new Boolean( enabled ) );
  -            context.put( "assembly:appliance.activation", new Boolean( activation ) );
  -            context.put( "assembly:appliance.classloader", m_classloader );
  -            context.put( "assembly:logger", m_logger );
  +            context.put( "urn:assembly:appliance.profile", profile );
  +            context.put( "urn:assembly:appliance.enabled", new Boolean( enabled ) );
  +            context.put( "urn:assembly:appliance.activation", new Boolean( activation ) );
  +            context.put( "urn:assembly:appliance.classloader", m_classloader );
               context.makeReadOnly();
  -
               appliance.contextualize( context );
   
               appliance.service( m_manager );
  @@ -542,6 +564,11 @@
       */
       private LifestyleService bootstrapLifestyleService( ServiceManager manager ) throws Exception
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "bootstrap lifestyle" );
  +        }
  +
           DefaultLifestyleService lifestyle = new DefaultLifestyleService();
           lifestyle.enableLogging( getLogger().getChildLogger( "lifestyle" ) );
           lifestyle.service( manager );
  @@ -555,13 +582,27 @@
       * @param manager a service manager
       * @return the bootstrap assembly service
       */
  -    private AssemblyService bootstrapAssemblyService( ServiceManager manager ) throws ServiceException
  +    private AssemblyService bootstrapAssemblyService() throws ServiceException
       {
  +        if( getLogger() == null )
  +        {
  +            throw new IllegalStateException( "logger" );
  +        }
  +        if( m_manager == null )
  +        {
  +            throw new IllegalStateException( "service" );
  +        }
  +
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "bootstrap assembly" );
  +        }
  +
           try
           {
               DefaultAssemblyService assembly = new DefaultAssemblyService();
               assembly.enableLogging( getLogger().getChildLogger( "assembly" ) );
  -            assembly.service( manager );
  +            assembly.service( m_manager );
               assembly.contextualize( m_context );
               assembly.initialize();
               return assembly;
  
  
  
  1.2       +2 -2      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultApplianceSelector.java
  
  Index: DefaultApplianceSelector.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultApplianceSelector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultApplianceSelector.java	29 Nov 2002 13:17:16 -0000	1.1
  +++ DefaultApplianceSelector.java	3 Dec 2002 06:57:25 -0000	1.2
  @@ -59,7 +59,7 @@
    * implementing the selector interface may be activated during the selection of
    * candidate service providers during assembly.  A component author may declare a 
    * selection class explicitly via a service dependency attribute with the attribute 
  - * name of <code>avalon:appliance.selector</code>.
  + * name of <code>urn:avalon:appliance.selector</code>.
    *
    * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
  
  
  
  1.2       +50 -11    avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAssemblyService.java
  
  Index: DefaultAssemblyService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAssemblyService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultAssemblyService.java	29 Nov 2002 13:17:16 -0000	1.1
  +++ DefaultAssemblyService.java	3 Dec 2002 06:57:25 -0000	1.2
  @@ -77,6 +77,12 @@
   public class DefaultAssemblyService extends AbstractLogEnabled implements AssemblyService, Contextualizable, Serviceable, Initializable
   {
       //==============================================================
  +    // static
  +    //==============================================================
  +
  +    private static final String ENGINE_KEY = "urn:assembly:engine";
  +
  +    //==============================================================
       // state
       //==============================================================
   
  @@ -103,7 +109,7 @@
       *     <td>key</td><td>type</td><td>default</td>
       *   </tr>
       *   <tr>
  -    *     <td>assembly:dependency-map</td>
  +    *     <td>urn:assembly:dependency-map</td>
       *     <td>org.apache.avalon.assembly.appliance.DepedendencyGraph</td>
       *     <td>The depedency graph.</td> 
       *   </tr>
  @@ -114,7 +120,7 @@
       {
           try
           {
  -            m_map = (DependencyGraph) context.get( "assembly:dependency-map" );
  +            m_map = (DependencyGraph) context.get( "urn:assembly:dependency-map" );
           }
           catch( ContextException e )
           {
  @@ -133,7 +139,14 @@
       */
       public void service( ServiceManager manager ) throws ServiceException
       {
  -        m_engine = (Engine) manager.lookup( "assembly:engine" );
  +         if( manager.hasService( ENGINE_KEY ) )
  +         {
  +             m_manager = manager;
  +         }
  +         else
  +         {
  +             throw new ServiceException( ENGINE_KEY );
  +         }
       }
   
       //==============================================================
  @@ -158,7 +171,7 @@
           {
               throw new IllegalStateException("contextaulize");
           }
  -        if( m_engine == null )
  +        if( m_manager == null )
           {
               throw new IllegalStateException("service");
           }
  @@ -184,6 +197,33 @@
           assembleAppliance( m_map, appliance, m_visited, "" );
       }
   
  +   /**
  +    * Utility to get the engine from the service manager.  This operation
  +    * should not be invoked before completion of initialization.
  +    * @return the engine
  +    * @exception IllegalStateException if invoked during or prior to 
  +    *    component initialization
  +    */
  +    protected Engine getEngine() throws IllegalStateException
  +    {
  +        if( m_engine == null )
  +        {
  +            if( !m_initialized )
  +            {
  +                throw new IllegalStateException("initialization");
  +            }
  +            try
  +            {
  +                m_engine = (Engine) m_manager.lookup( ENGINE_KEY );
  +            }
  +            catch( ServiceException e )
  +            {
  +                throw new IllegalStateException("engine");
  +            }
  +        }
  +        return m_engine;
  +    }
  +
       /**
        * Assemble a single appliance.
        * @param map the current depedency map to populate
  @@ -193,7 +233,6 @@
        * @param pad used in formatting log messages
        * @exception AssemblyException if an assembly related error occurs
        */
  -
       private void assembleAppliance(
           DependencyGraph map, Appliance appliance, List visited, String pad )
           throws AssemblyException
  @@ -203,7 +242,7 @@
           String pad2 = pad + "  ";
   
           //
  -        // for all of the declared depedencies - make sure the
  +        // for all of the declared dependencies - make sure the
           // dependency is satisfied
           //
   
  @@ -227,7 +266,7 @@
   
                   try
                   {
  -                    supplier = m_engine.resolve( dependency );
  +                    supplier = getEngine().resolve( dependency );
                   }
                   catch( Throwable e )
                   {
  @@ -283,7 +322,7 @@
   
                   try
                   {
  -                    supplier = m_engine.resolve( stage );
  +                    supplier = getEngine().resolve( stage );
                   }
                   catch( Throwable e )
                   {
  @@ -331,7 +370,7 @@
           Appliance provider;
           try
           {
  -            provider = m_engine.resolve( stage );
  +            provider = getEngine().resolve( stage );
           }
           catch( Throwable e )
           {
  @@ -357,7 +396,7 @@
           Appliance provider;
           try
           {
  -            provider = m_engine.resolve( dependency );
  +            provider = getEngine().resolve( dependency );
           }
           catch( Throwable e )
           {
  
  
  
  1.4       +160 -56   avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/engine/DefaultEngine.java
  
  Index: DefaultEngine.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/engine/DefaultEngine.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultEngine.java	30 Nov 2002 21:46:39 -0000	1.3
  +++ DefaultEngine.java	3 Dec 2002 06:57:26 -0000	1.4
  @@ -57,11 +57,17 @@
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.DefaultServiceManager;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.meta.info.DependencyDescriptor;
   import org.apache.avalon.meta.info.StageDescriptor;
  @@ -78,6 +84,7 @@
   import org.apache.avalon.assembly.lifestyle.LifestyleException;
   import org.apache.avalon.assembly.lifestyle.LifestyleService;
   import org.apache.avalon.assembly.lifestyle.DefaultLifestyleService;
  +import org.apache.avalon.assembly.logging.LoggingManager;
   import org.apache.excalibur.mpool.DefaultPoolManager;
   import org.apache.excalibur.mpool.PoolManager;
   import org.apache.excalibur.event.command.CommandManager;
  @@ -89,7 +96,7 @@
    * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public class DefaultEngine extends AbstractLogEnabled implements Engine, Contextualizable, Initializable
  +public class DefaultEngine extends AbstractLogEnabled implements Engine, Configurable, Contextualizable, Serviceable, Initializable
   {
       //==============================================================
       // static
  @@ -108,6 +115,12 @@
       //==============================================================
   
      /**
  +    * The supplied configuration.  The configuration may be empty
  +    * as defaults are provided for all values.
  +    */
  +    private Configuration m_config;
  +
  +   /**
       * The system wide context where system refers to the context that
       * will be propergated by this engine to compoents under it 
       * supervision.
  @@ -146,15 +159,32 @@
   
      /**
       * A map of custom context entries that suppliment the standard system 
  -    * context at the scope of this engine.  The map ius supplied by a client
  +    * context at the scope of this engine.  The map is supplied by a client
       * at the time of engine establishment via the engine context.
       */
       private Map m_map;
   
      /**
  -    * The logging channel for system level functions.
  +    * The default logging manager. The manager is supplied under contextualization
  +    * phase.
  +    */
  +    private LoggingManager m_logging;
  +
  +    //==============================================================
  +    // Configurable
  +    //==============================================================
  +
  +   /**
  +    * Supply of the static configuration for the deployment service.
  +    * @param config the static configuration
       */
  -    private Logger m_logger;
  +    public void configure( Configuration config ) throws ConfigurationException
  +    {
  +        if( config == null )
  +        {
  +            throw new NullPointerException( "config" );
  +        }
  +    }
   
       //==============================================================
       // Contextualizable
  @@ -170,7 +200,7 @@
       {
           try
           {
  -            m_classloader = (ClassLoader) context.get( "assembly:classloader" );
  +            m_classloader = (ClassLoader) context.get( "urn:assembly:classloader" );
           }
           catch( ContextException ce )
           {
  @@ -179,7 +209,7 @@
   
           try
           {
  -            m_types = (TypeManager) context.get( "assembly:type-manager" );
  +            m_types = (TypeManager) context.get( "urn:assembly:type-manager" );
           }
           catch( ContextException ce )
           {
  @@ -188,7 +218,7 @@
   
           try
           {
  -            m_profiles = (ProfileManager) context.get( "assembly:profile-manager" );
  +            m_profiles = (ProfileManager) context.get( "urn:assembly:profile-manager" );
           }
           catch( ContextException ce )
           {
  @@ -197,7 +227,7 @@
   
           try
           {
  -            m_appliances = (ApplianceManager) context.get( "assembly:appliance-manager" );
  +            m_appliances = (ApplianceManager) context.get( "urn:assembly:appliance-manager" );
           }
           catch( ContextException ce )
           {
  @@ -206,7 +236,7 @@
   
           try
           {
  -            m_map = (Map) context.get( "assembly:system-map" );
  +            m_map = (Map) context.get( "urn:assembly:system-map" );
           }
           catch( ContextException ce )
           {
  @@ -215,18 +245,57 @@
       }
   
       //==============================================================
  +    // Serviceable
  +    //==============================================================
  +
  +   /**
  +    * <p>Application of a supporting service to the engine.</p>
  +    * <table>
  +    *   <tr>
  +    *     <td>key</td><td>type</td><td>description</td>
  +    *   </tr>
  +    *   <tr>
  +    *     <td>urn:assembly:logging.manager</td>
  +    *     <td>{@link org.apache.assembly.logging.LoggingManager}</td>
  +    *     <td>A logging manager.</td> 
  +    *   </tr>
  +    * </table>
  +    * @param manager the service manager
  +    */
  +    public void service( ServiceManager manager ) throws ServiceException
  +    {
  +        if( manager == null )
  +        {
  +            throw new NullPointerException( "manager" );
  +        }
  +
  +        String key = "urn:assembly:logging.manager";
  +        m_logging = (LoggingManager) manager.lookup( key );
  +    }
  +
  +    //==============================================================
       // Initializable
       //==============================================================
   
  +   /**
  +    * Initialization of the engine.
  +    * @exception if an initialization error occurs
  +    */
       public void initialize() throws Exception
       {
           if( getLogger() == null )
           {
               throw new IllegalStateException("logger");
           }
  -        else
  +
  +        if( m_logging == null )
           {
  -            m_logger = getLogger().getChildLogger( SYSTEM_LOG_CATEGORY );
  +            throw new IllegalStateException("service");
  +        }
  +
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "initialization" );
           }
   
           if( m_classloader == null )
  @@ -236,17 +305,17 @@
   
           if( m_types == null )
           {
  -            m_types = createTypeManager( m_classloader, m_logger );
  +            m_types = createTypeManager( );
           }
   
           if( m_profiles == null )
           {
  -            m_profiles = createProfileManager( m_classloader, m_logger );
  +            m_profiles = createProfileManager();
           }
   
           if( m_appliances == null )
           {
  -            m_appliances = createApplianceManager( m_classloader, m_logger );
  +            m_appliances = createApplianceManager();
           }
       }
   
  @@ -261,6 +330,11 @@
       */
       public void register( String path ) throws EngineRuntimeException
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "register:" + path );
  +        }
  +
           try
           {
               Type type = m_types.createType( path );
  @@ -285,6 +359,11 @@
       */
       public Appliance resolve( DependencyDescriptor dependency ) throws Exception
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "resolve: " + dependency );
  +        }
  +
           Appliance appliance = m_appliances.getAppliance( dependency );
           if( appliance == null )
           {
  @@ -312,6 +391,11 @@
       */
       public Appliance resolve( StageDescriptor stage ) throws Exception
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "resolve: " + stage );
  +        }
  +
           Appliance appliance = m_appliances.getAppliance( stage );
           if( appliance == null )
           {
  @@ -378,56 +462,71 @@
       {
           try
           {
  -            return (ClassLoader) context.get( "assembly:classloader" );
  +            return (ClassLoader) context.get( "urn:assembly:classloader" );
           }
           catch( ContextException ce )
           {
  +            if( getLogger().isDebugEnabled() )
  +            {
  +                getLogger().debug( "assigning context classloader" );
  +            }
  +
               return Thread.currentThread().getContextClassLoader();
           }
       }
   
  -    private TypeManager createTypeManager( ClassLoader classloader, Logger logger ) throws Exception
  +    private TypeManager createTypeManager( ) throws Exception
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "bootstrap type manager" );
  +        }
           DefaultTypeManager manager = new DefaultTypeManager();
  -        manager.enableLogging( logger.getChildLogger("types") );
  +        manager.enableLogging( getLogger().getChildLogger( "types" ) );
           DefaultContext context = new DefaultContext();
  -        context.put( "assembly:classloader", classloader );
  +        context.put( "urn:assembly:classloader", m_classloader );
           context.makeReadOnly();
           manager.contextualize( context );
           manager.initialize();
           return manager;
       }
   
  -    private ProfileManager createProfileManager( ClassLoader classloader, Logger logger ) throws Exception
  +    private ProfileManager createProfileManager(  ) throws Exception
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "bootstrap profile manager" );
  +        }
           DefaultProfileManager manager = new DefaultProfileManager();
  -        manager.enableLogging( logger.getChildLogger("profiles") );
  +        manager.enableLogging( getLogger().getChildLogger( "profiles" ) );
           DefaultContext context = new DefaultContext();
  -        context.put( "assembly:classloader", classloader );
  +        context.put( "urn:assembly:classloader", m_classloader );
           context.makeReadOnly();
           manager.contextualize( context );
           manager.initialize();
           return manager;
       }
   
  -    private ApplianceManager createApplianceManager( ClassLoader classloader, Logger logger ) throws Exception
  +    private ApplianceManager createApplianceManager() throws Exception
       {
  -        DefaultApplianceManager manager = new DefaultApplianceManager();
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "bootstrap appliance manager" );
  +        }
   
  -        manager.enableLogging( logger );
  +        DefaultApplianceManager manager = new DefaultApplianceManager();
   
  +        manager.enableLogging( getLogger() );
           DefaultContext context = new DefaultContext( getSystemContext() );
  -        context.put( "assembly:classloader", classloader );
  -        context.put( "assembly:pool-manager", getPoolManager( logger ) );
  -        context.put( "assembly:logger", getLogger() );
  +        context.put( "urn:assembly:classloader", m_classloader );
  +        context.put( "urn:assembly:pool-manager", getPoolManager( ) );
           context.makeReadOnly();
           manager.contextualize( context );
  -
           DefaultServiceManager services = new DefaultServiceManager();
  -        services.put( "assembly:engine", this );
  +        services.put( "urn:assembly:engine", this );
  +        services.put( "urn:assembly:logging.manager", m_logging );
           services.makeReadOnly();
           manager.service( services );
  -
           manager.initialize();
   
           return manager;
  @@ -435,35 +534,40 @@
   
       private Context getSystemContext()
       {
  -        if( m_context == null )
  +        if( getLogger().isDebugEnabled() )
           {
  -            DefaultContext context;
  -            if( m_map != null )
  -            {
  -                context = new DefaultContext( m_map );
  -            }
  -            else
  -            {
  -                context = new DefaultContext();
  -            }
  +            getLogger().debug( "bootstrap system context" );
  +        }
   
  -            try
  -            {
  -                context.get( "avalon:home" );
  -            }
  -            catch( ContextException ce )
  -            {
  -                final File home = new File( System.getProperty( "user.dir" ) );
  -                context.put( "avalon:home", home );
  -            }
  -    
  -            m_context = context;
  +        DefaultContext context;
  +        if( m_map != null )
  +        {
  +            context = new DefaultContext( m_map );
           }
  -        return m_context;
  +        else
  +        {
  +            context = new DefaultContext();
  +        }
  +
  +        try
  +        {
  +            context.get( "urn:avalon:home" );
  +        }
  +        catch( ContextException ce )
  +        {
  +            final File home = new File( System.getProperty( "user.dir" ) );
  +            context.put( "urn:avalon:home", home );    
  +        }
  +        return context;
       }
   
  -    private PoolManager getPoolManager( Logger logger )
  +    private PoolManager getPoolManager( )
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "bootstrap pool manager" );
  +        }
  +
           try
           {
               //
  @@ -471,7 +575,7 @@
               //
   
               TPCThreadManager threadManager = new TPCThreadManager();
  -            threadManager.enableLogging( logger.getChildLogger( "threads" ) );
  +            threadManager.enableLogging( getLogger().getChildLogger( "threads" ) );
               Parameters params = new Parameters();
               params.setParameter( "threads-per-processor", "2" );
               params.setParameter( "sleep-time", "1000" );
  @@ -497,7 +601,7 @@
           catch( Throwable e )
           {
               final String error = 
  -              "Internel error during establishment of the default pool manager.";
  +              "Internal error during establishment of the default pool manager.";
               throw new EngineRuntimeException( error, e );
           }
       }
  
  
  
  1.2       +2 -2      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/ContextHandler.java
  
  Index: ContextHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/ContextHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ContextHandler.java	30 Nov 2002 14:47:51 -0000	1.1
  +++ ContextHandler.java	3 Dec 2002 06:57:26 -0000	1.2
  @@ -100,7 +100,7 @@
       public void contextualize( Context context ) throws ContextException
       {
           m_context = context;
  -        m_classloader = (ClassLoader) context.get( "assembly:classloader" );
  +        m_classloader = (ClassLoader) context.get( "urn:assembly:classloader" );
       }
   
       //==============================================================
  
  
  
  1.3       +20 -18    avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/DefaultDeploymentService.java
  
  Index: DefaultDeploymentService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/DefaultDeploymentService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultDeploymentService.java	30 Nov 2002 21:46:39 -0000	1.2
  +++ DefaultDeploymentService.java	3 Dec 2002 06:57:26 -0000	1.3
  @@ -58,6 +58,7 @@
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.DefaultServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.framework.component.Composable;
  @@ -83,6 +84,7 @@
   import org.apache.avalon.assembly.lifecycle.disposal.DisposalService;
   import org.apache.avalon.assembly.lifecycle.disposal.DefaultDisposalService;
   import org.apache.avalon.assembly.lifecycle.disposal.ExtendedDisposalService;
  +import org.apache.avalon.assembly.logging.LoggingManager;
   
   /**
    * A deployment service is responsible for the deployment of a component 
  @@ -130,7 +132,6 @@
             config.getChild("extensions").getAttributeAsBoolean( "enabled", true );
       }
   
  -
       //==============================================================
       // Contextualizable
       //==============================================================
  @@ -161,7 +162,7 @@
       *     <td>key</td><td>type</td><td>description</td>
       *   </tr>
       *   <tr>
  -    *     <td>assembly:lifecycle.logging</td>
  +    *     <td>urn:assembly:lifecycle.logging</td>
       *     <td>{@link org.apache.avalon.assembly.logging.LoggingService}</td>
       *     <td>The logging service to use for the creation of auxiliary logging channels.</td> 
       *   </tr>
  @@ -177,49 +178,49 @@
   
           m_manager = manager;
   
  -        String key = "assembly:lifecycle.logging";
  +        String key = "urn:assembly:lifecycle.logging";
           if( manager.hasService( key ) )
           {
               m_logging = (LoggingService) manager.lookup( key );
           }
   
  -        key = "assembly:lifecycle.configuration"; 
  +        key = "urn:assembly:lifecycle.configuration"; 
           if( manager.hasService( key ) )
           {
               m_configuration = (ConfigurationService) manager.lookup( key );
           }
   
  -        key = "assembly:lifecycle.parameters"; 
  +        key = "urn:assembly:lifecycle.parameters"; 
           if( manager.hasService( key ) )
           {
               m_parameters = (ParameterizationService) manager.lookup( key );
           }
   
  -        key = "assembly:lifecycle.context"; 
  +        key = "urn:assembly:lifecycle.context"; 
           if( manager.hasService( key ) )
           {
               m_contextualization = (ContextualizationService) manager.lookup( key );
           }
   
  -        key = "assembly:lifecycle.assembly";
  +        key = "urn:assembly:lifecycle.assembly";
           if( manager.hasService( key ) )
           {
               m_composition = (CompositionService) manager.lookup( key );
           }
   
  -        key = "assembly:lifecycle.initialization"; 
  +        key = "urn:assembly:lifecycle.initialization"; 
           if( manager.hasService( key ) )
           {
               m_initialization = (InitializationService) manager.lookup( key );
           }
   
  -        key = "assembly:lifecycle.startup"; 
  +        key = "urn:assembly:lifecycle.startup"; 
           if( manager.hasService( key ) )
           {
               m_startup = (StartupService) manager.lookup( key );
           }
   
  -        key = "assembly:lifecycle.disposal";
  +        key = "urn:assembly:lifecycle.disposal";
           if( manager.hasService( key ) )
           {
               m_disposal = (DisposalService) manager.lookup( key );
  @@ -287,11 +288,10 @@
       * containment context.
       * @param classloader the classloader to use
       * @param appliance the appliance to deploy
  -    * @param logger the base logging channel to assign to the component
       * @param context the containment context
       * @return the deployed component
       */
  -    public Object deploy( Appliance appliance, ClassLoader classloader, Logger logger, Context context ) 
  +    public Object deploy( Appliance appliance, ClassLoader classloader, Context context ) 
         throws DeploymentException
       {
           if( !m_initialized )
  @@ -307,10 +307,6 @@
           {
               throw new NullPointerException( "classloader" );
           }
  -        if( logger == null )
  -        {
  -            throw new NullPointerException( "logger" );
  -        }
           if( context == null )
           {
               throw new NullPointerException( "context" );
  @@ -335,7 +331,7 @@
   
           try
           {
  -            m_logging.enableLogging( appliance, instance, logger );
  +            m_logging.enableLogging( appliance, instance );
               m_configuration.configure( appliance, instance );
               m_parameters.parameterize( appliance, instance );
               m_contextualization.contextualize( appliance, instance, context );
  @@ -384,6 +380,12 @@
           {
               DefaultLoggingService service = new DefaultLoggingService();
               service.enableLogging( getLogger().getChildLogger( "logging" ) );
  +            LoggingManager logging = 
  +              (LoggingManager) m_manager.lookup( "urn:assembly:logging.manager" );
  +            DefaultServiceManager manager = new DefaultServiceManager();
  +            manager.put( "urn:assembly:logging.manager", logging );
  +            service.service( manager );
  +            service.initialize();
               return service;
           }
           catch( Throwable e )
  
  
  
  1.2       +2 -2      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/DeploymentService.java
  
  Index: DeploymentService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/DeploymentService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeploymentService.java	29 Nov 2002 13:19:09 -0000	1.1
  +++ DeploymentService.java	3 Dec 2002 06:57:26 -0000	1.2
  @@ -80,7 +80,7 @@
       * @param context the containment context
       * @return the deployed component
       */
  -    Object deploy( Appliance appliance, ClassLoader classloader, Logger logger, Context context ) 
  +    Object deploy( Appliance appliance, ClassLoader classloader, Context context ) 
         throws DeploymentException;
   
      /**
  
  
  
  1.4       +97 -8     avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/DefaultLoggingService.java
  
  Index: DefaultLoggingService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/DefaultLoggingService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultLoggingService.java	30 Nov 2002 21:46:39 -0000	1.3
  +++ DefaultLoggingService.java	3 Dec 2002 06:57:26 -0000	1.4
  @@ -50,10 +50,21 @@
   
   package org.apache.avalon.assembly.lifecycle.logging;
   
  +import java.util.ArrayList;
  +
  +import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.assembly.appliance.Appliance;
  +import org.apache.avalon.assembly.logging.LoggingManager;
  +import org.apache.avalon.meta.info.LoggerDescriptor;
  +import org.apache.avalon.meta.model.Profile;
  +import org.apache.avalon.meta.model.LoggingDirective;
  +import org.apache.avalon.meta.model.Category;
   
   /**
    * Service that handles the assignment of logging channels to a component.
  @@ -61,15 +72,54 @@
    * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public class DefaultLoggingService extends AbstractLogEnabled implements LoggingService
  +public class DefaultLoggingService extends AbstractLogEnabled implements Serviceable, Initializable, LoggingService
   {
  +    //==============================================================
  +    // state
  +    //==============================================================
  +
  +    private LoggingManager m_manager;
  +
  +    //==============================================================
  +    // Serviceable
  +    //==============================================================
  +
  +   /**
  +    * <p>Application of a logging manager to this service.</p>
  +    * @param manager the service manager
  +    */
  +    public void service( ServiceManager manager ) throws ServiceException
  +    {
  +        m_manager = (LoggingManager) manager.lookup( "urn:assembly:logging.manager" );
  +    }
  +
  +    //==============================================================
  +    // Initializable
  +    //==============================================================
  +
  +   /**
  +    * Initialization of the logging service.
  +    * @exception Exception if an initialization error occurs
  +    */
  +    public void initialize() throws Exception
  +    {
  +        if( m_manager == null )
  +        {
  +            throw new IllegalStateException("service");
  +        }
  +    }
  +
  +    //==============================================================
  +    // LoggingService
  +    //==============================================================
  +
      /**
  -    * Applies logging base logging channel; from which a componet logger shall be derived
  +    * Applies primary and subsidiary logging channels to the component.
       * @param appliance the appliace
       * @param object the object to which logging channels will be assigned
  -    * @param the base logging channel
  +    * @param path the absolute logging category path
       */
  -    public void enableLogging( Appliance appliance, Object object, Logger logger ) 
  +    public void enableLogging( Appliance appliance, Object object ) 
         throws Exception
       {
           if( appliance == null )
  @@ -89,11 +139,50 @@
                   final String message = "[" + name + "]";
                   getLogger().debug( message );
               }
  -            if( logger == null )
  +
  +            String path = appliance.getPath();
  +
  +            LoggingDirective logging = buildLoggingCategories( appliance.getProfile() );
  +            m_manager.addCategories( path, logging );
  +
  +            Logger logger = m_manager.getLoggerForCategory( path );
  +            ((LogEnabled)object).enableLogging( logger );
  +        }
  +    }
  +
  +    /**
  +     * Create a categories descriptor that takes into account both type logging
  +     * category declarations and the profile level logging category definitions
  +     * under a single <code>LoggingDirective</code> instance.
  +     *
  +     * @param profile the profile defining the type and profile level category
  +     *   information
  +     * @return a new fully populated <code>LoggingDirective</code>
  +     */
  +    private LoggingDirective buildLoggingCategories( Profile profile )
  +    {
  +        LoggingDirective categories = profile.getCategories();
  +        LoggerDescriptor[] loggers = profile.getType().getLoggers();
  +        ArrayList list = new ArrayList();
  +        for( int i = 0; i < loggers.length; i++ )
  +        {
  +            String name = loggers[ i ].getName();
  +            Category category = categories.getCategory( name );
  +            if( category != null )
               {
  -                throw new NullPointerException( "logger" );
  +                list.add( category );
  +            }
  +            else
  +            {
  +                list.add( new Category( name ) );
               }
  -            ((LogEnabled)object).enableLogging( logger.getChildLogger( name ) );
           }
  +
  +        return new LoggingDirective(
  +            categories.getName(),
  +            categories.getPriority(),
  +            categories.getTarget(),
  +            (Category[])list.toArray( new Category[ 0 ] ));
       }
  +
   }
  
  
  
  1.2       +2 -2      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/LoggingService.java
  
  Index: LoggingService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/LoggingService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoggingService.java	29 Nov 2002 13:04:55 -0000	1.1
  +++ LoggingService.java	3 Dec 2002 06:57:26 -0000	1.2
  @@ -68,6 +68,6 @@
       * @param appliance the appliace
       * @param object the object to which logging channels will be assigned
       */
  -    void enableLogging( Appliance appliance, Object object, Logger logger ) 
  +    void enableLogging( Appliance appliance, Object object ) 
         throws Exception;
   }
  
  
  
  1.6       +8 -14     avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/AbstractLifestyleHandler.java
  
  Index: AbstractLifestyleHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/AbstractLifestyleHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractLifestyleHandler.java	30 Nov 2002 18:12:06 -0000	1.5
  +++ AbstractLifestyleHandler.java	3 Dec 2002 06:57:26 -0000	1.6
  @@ -98,11 +98,6 @@
       private ClassLoader m_classloader;
   
      /**
  -    * The logging channel to assign to instance creeated by this handler.
  -    */
  -    private Logger m_logger;
  -
  -   /**
       * The deplyment service to handle lifecycle processing of 
       * component implementations established by this handler.
       */
  @@ -133,7 +128,7 @@
       *     <td>key</td><td>type</td><td>description</td>
       *   </tr>
       *   <tr>
  -    *     <td>assembly:appliance.target</td>
  +    *     <td>urn:assembly:appliance.target</td>
       *     <td>{@link org.apache.avalon.appliance.Appliance}</td>
       *     <td>The appliance that this manager is managing.</td> 
       *   </tr>
  @@ -143,12 +138,11 @@
       public void contextualize( Context context ) throws ContextException
       {
           super.contextualize( context );
  -        m_logger = (Logger) context.get( "avalon:logger" );
  -        m_classloader = (ClassLoader) context.get( "avalon:classloader" );
  -        m_appliance = (Appliance) context.get( "assembly:appliance.target" );
  +        m_classloader = (ClassLoader) context.get( "urn:avalon:classloader" );
  +        m_appliance = (Appliance) context.get( "urn:assembly:appliance.target" );
           try
           {
  -            m_context = (Context) context.get( "assembly:deployment.context" );
  +            m_context = (Context) context.get( "urn:assembly:deployment.context" );
           }
           catch( ContextException ce )
           {
  @@ -167,7 +161,7 @@
       *     <td>key</td><td>type</td><td>description</td>
       *   </tr>
       *   <tr>
  -    *     <td>assembly:lifestyle.deployment</td>
  +    *     <td>urn:assembly:lifestyle.deployment</td>
       *     <td>{@link org.apache.avalon.assembly.lifecycle.DeploymentService}</td>
       *     <td>The deplyment service that will handle deployment and decommissioning
       *         of instances derived from the appliance.</td> 
  @@ -177,7 +171,7 @@
       */
       public void service( ServiceManager manager ) throws ServiceException
       {
  -        m_deployment = (DeploymentService) manager.lookup( "assembly:deployment-service" );
  +        m_deployment = (DeploymentService) manager.lookup( "urn:assembly:deployment-service" );
       }
   
       //==============================================================
  @@ -270,7 +264,7 @@
       {
           try
           {
  -            return m_deployment.deploy( m_appliance, m_classloader, m_logger, m_context );
  +            return m_deployment.deploy( m_appliance, m_classloader, m_context );
           }
           catch( Throwable e )
           {
  
  
  
  1.3       +7 -18     avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/DefaultLifestyleService.java
  
  Index: DefaultLifestyleService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/DefaultLifestyleService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultLifestyleService.java	30 Nov 2002 21:46:39 -0000	1.2
  +++ DefaultLifestyleService.java	3 Dec 2002 06:57:26 -0000	1.3
  @@ -177,7 +177,7 @@
               throw new IllegalStateException("manager");
           }
   
  -        String key = "assembly:deployment-service";
  +        String key = "urn:assembly:deployment-service";
           if( !m_manager.hasService( key ) )
           {
               DefaultServiceManager manager = new DefaultServiceManager( m_manager );
  @@ -197,12 +197,10 @@
       * Creation of a new lifestyle handler.
       * @param appliance the appliance that the handler will manage
       * @param classloader the classloader to assign to the handler
  -    * @param logger the logging channel to be assigned to new 
  -    *    instances of the appliance
       * @param context a deployment context
       */
       public LifestyleHandler createHandler( 
  -      Appliance appliance, ClassLoader classloader, Logger system, Logger logger, Context deploymentContext )
  +      Appliance appliance, ClassLoader classloader, Context deploymentContext )
       {
           if( !m_initialized )
           {
  @@ -217,14 +215,6 @@
           {
               throw new NullPointerException("classloader");
           }
  -        if( system == null )
  -        {
  -            throw new NullPointerException("system");
  -        }
  -        if( logger == null )
  -        {
  -            throw new NullPointerException("logger");
  -        }
   
           //
           // create the deployment context to be supplied to the handler
  @@ -233,11 +223,10 @@
           DefaultContext context = new DefaultContext( m_context );
           if( deploymentContext != null )
           {
  -            context.put( "assembly:deployment.context", deploymentContext );
  +            context.put( "urn:assembly:deployment.context", deploymentContext );
           }
  -        context.put( "assembly:appliance.target", appliance );
  -        context.put( "avalon:classloader", classloader );
  -        context.put( "avalon:logger", logger );
  +        context.put( "urn:assembly:appliance.target", appliance );
  +        context.put( "urn:avalon:classloader", classloader );
           context.makeReadOnly();
   
           //
  @@ -247,7 +236,7 @@
   
           final String policy =
               appliance.getProfile().getType().getInfo().getAttribute( 
  -              "avalon:lifestyle", "singleton" );
  +              "urn:avalon:lifestyle", "singleton" );
   
           if( policy.equalsIgnoreCase( "singleton" ) )
           {
  
  
  
  1.3       +2 -4      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/LifestyleService.java
  
  Index: LifestyleService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/LifestyleService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LifestyleService.java	30 Nov 2002 21:46:39 -0000	1.2
  +++ LifestyleService.java	3 Dec 2002 06:57:26 -0000	1.3
  @@ -68,10 +68,8 @@
       * @param appliance the appliance that the handler will manage
       * @param classloader the classloader to assign to the handler
       * @param system the logging channel for the handler
  -    * @param logger the logging channel to be assigned to new 
  -    *    instances of the appliance
       * @param context a deployment context
       */
       LifestyleHandler createHandler( 
  -      Appliance appliance, ClassLoader classloader, Logger system, Logger logger, Context context );
  +      Appliance appliance, ClassLoader classloader, Context context );
   }
  
  
  
  1.3       +4 -4      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/PooledLifestyleHandler.java
  
  Index: PooledLifestyleHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/lifestyle/PooledLifestyleHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PooledLifestyleHandler.java	29 Nov 2002 17:37:30 -0000	1.2
  +++ PooledLifestyleHandler.java	3 Dec 2002 06:57:26 -0000	1.3
  @@ -153,7 +153,7 @@
       public void contextualize( Context context ) throws ContextException
       {
           super.contextualize( context );
  -        m_poolManager = (PoolManager) context.get( "assembly:pool-manager" );
  +        m_poolManager = (PoolManager) context.get( "urn:assembly:pool-manager" );
           m_context = context;
       }
   
  @@ -170,8 +170,8 @@
       {
           super.initialize();
           m_pool = m_poolManager.getManagedPool( this, m_size );
  -        m_appliance = (Appliance) m_context.get( "assembly:appliance.target" );
  -        ClassLoader classloader = (ClassLoader) m_context.get( "avalon:classloader" );
  +        m_appliance = (Appliance) m_context.get( "urn:assembly:appliance.target" );
  +        ClassLoader classloader = (ClassLoader) m_context.get( "urn:avalon:classloader" );
           m_class = classloader.loadClass( m_appliance.getProfile().getType().getInfo().getClassname() );
       }
   
  
  
  
  1.2       +101 -44   avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/logging/DefaultLoggingManager.java
  
  Index: DefaultLoggingManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/logging/DefaultLoggingManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultLoggingManager.java	29 Nov 2002 13:22:20 -0000	1.1
  +++ DefaultLoggingManager.java	3 Dec 2002 06:57:26 -0000	1.2
  @@ -61,6 +61,10 @@
   import org.apache.log.output.io.FileTarget;
   import org.apache.log.output.io.StreamTarget;
   
  +import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AvalonFormatter;
   import org.apache.avalon.framework.logger.LogKitLogger;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
  @@ -76,8 +80,11 @@
    * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a>
    */
   public class DefaultLoggingManager
  -    implements LoggingManager
  +    implements LoggingManager, Initializable, Contextualizable
   {
  +    //===============================================================
  +    // static
  +    //===============================================================
   
       /**
        * The default logging priority value.
  @@ -95,71 +102,94 @@
       private static final String DEFAULT_FORMAT =
           "[%7.7{priority}] (%{category}): %{message}\\n%{throwable}";
   
  +    //===============================================================
  +    // state
  +    //===============================================================
  +
       /**
        * Base directory of file targets.
        */
       private File m_baseDirectory;
   
       /**
  -     * log hierarchy.
  +     * The list of logging targets.
  +     */
  +    private LoggingDescriptor m_descriptor;
  +
  +    /**
  +     * The implementation log hierarchy.
        */
       private Hierarchy m_logHierarchy;
   
       /**
  -     * default logger
  +     * The efault logging channel.
        */
       private org.apache.avalon.framework.logger.Logger m_logger;
   
       /**
  -     * default logger target
  +     * The default fallback log target.
        */
  -    private StreamTarget m_stream;
  +    private StreamTarget m_stream = 
  +      new StreamTarget( System.out, new AvalonFormatter( DEFAULT_FORMAT ) );
   
  +    /**
  +     * The list of logging targets.
  +     */
       private final HashMap m_targets = new HashMap();
   
  -    private DefaultLoggingManager m_parent;
  -
  -    private String m_category;
  +    //==============================================================
  +    // Contextualizable
  +    //==============================================================
   
  -    //===============================================================
  -    // constructor
  -    //===============================================================
  -
  -    /**
  -     * Creation of a new LoggerManager.
  -     * @param base the base directory
  -     * @exception Exception is an error occurs
  -     */
  -    public DefaultLoggingManager( File base ) throws Exception
  +   /**
  +    * <p>Application of a runtime context to the lifestyle service.
  +    * The context value will be passed directly to lifestyle handlers 
  +    * established by this service.
  +    * @param context the runtime context
  +    */
  +    public void contextualize( Context context ) throws ContextException
       {
  -        this(
  -            new LoggingDescriptor(
  +        m_baseDirectory = (File) context.get( "urn:avalon:home" );
  +
  +        try
  +        {
  +            m_descriptor = (LoggingDescriptor) context.get( "urn:assembly:logging.descriptor" );
  +        }
  +        catch( ContextException ce )
  +        {
  +            m_descriptor = 
  +              new LoggingDescriptor(
                   "", null, null, new TargetDescriptor[ 0 ],
  -                new Category( "logging", "DEBUG", null ) ), base );
  +                new Category( "logging", "DEBUG", null ) );
  +        }
       }
   
  +    //===============================================================
  +    // Initilizable
  +    //===============================================================
  +
       /**
  -     * Creation of a new LoggerManager.
  -     * @param descriptor the logging system description
  -     * @param base the base directory
  -     * @exception Exception is an error occurs
  +     * Logging manager initialization.
  +     * @exception Exception is an initializate stage error occurs
        */
  -    public DefaultLoggingManager( final LoggingDescriptor descriptor, File base ) throws Exception
  +    public void initialize() throws Exception
       {
  +        if( m_baseDirectory == null )
  +        {
  +            throw new IllegalStateException( "context" );
  +        }
   
           //
           // setup the hierarchy, default logging target, and default priority
           //
   
  -        m_stream = new StreamTarget( System.out, new AvalonFormatter( DEFAULT_FORMAT ) );
  -        m_baseDirectory = base;
           m_logHierarchy = new Hierarchy();
           getHierarchy().setDefaultLogTarget( m_stream );
           m_targets.put( DEFAULT_TARGET, m_stream );
  -        if( descriptor.getPriority() != null )
  +        if( m_descriptor.getPriority() != null )
           {
               getHierarchy().setDefaultPriority(
  -                Priority.getPriorityForName( descriptor.getPriority() )
  +                Priority.getPriorityForName( m_descriptor.getPriority() )
               );
           }
           else
  @@ -173,16 +203,16 @@
           // setup the bootstrap logging category
           //
   
  -        Category bootstrap = descriptor.getBootstrapCategory();
  +        Category bootstrap = m_descriptor.getBootstrapCategory();
  +
           m_logger = new LogKitLogger(
  -            addCategory(
  -                bootstrap.getName(), bootstrap.getPriority(), bootstrap.getTarget(), false ) );
  +          addCategory( bootstrap.getName(), bootstrap.getPriority(), bootstrap.getTarget(), false ) );
   
           //
           // build targets based on the information contained in the descriptor
           //
   
  -        TargetDescriptor[] targets = descriptor.getTargetDescriptors();
  +        TargetDescriptor[] targets = m_descriptor.getTargetDescriptors();
           for( int i = 0; i < targets.length; i++ )
           {
               addTarget( targets[ i ] );
  @@ -192,7 +222,7 @@
           // set the default target
           //
   
  -        String name = descriptor.getTarget();
  +        String name = m_descriptor.getTarget();
           if( name != null )
           {
               LogTarget target = (LogTarget)m_targets.get( name );
  @@ -203,7 +233,8 @@
               else
               {
                   throw new LoggerException(
  -                    "Supplied default logging target: '" + name + "' does not exist." );
  +                  "Supplied default logging target: '" 
  +                  + name + "' does not exist." );
               }
           }
       }
  @@ -244,6 +275,7 @@
           }
       }
   
  +
       /**
        * Create a logging channel configured with the supplied category path,
        * priority and target.
  @@ -298,7 +330,7 @@
           }
           else
           {
  -            String cat;
  +            String cat = filter( category );
               if( category.indexOf( "/" ) > -1 )
               {
                   cat = category.replace( '/', '.' );
  @@ -311,7 +343,14 @@
               {
                   cat = category;
               }
  -            return new LogKitLogger( getHierarchy().getLoggerFor( cat ) );
  +            try
  +            {
  +                return new LogKitLogger( getHierarchy().getLoggerFor( cat ) );
  +            }
  +            catch( Throwable e )
  +            {
  +                throw new RuntimeException( "Bad category: " + category + " or trans: " + cat );
  +            }
           }
       }
   
  @@ -348,7 +387,18 @@
   
       private Logger addCategory( String path, String priority, String target, boolean notify )
       {
  -        final Logger logger = getHierarchy().getLoggerFor( path );
  +        final String name = filter( path );
  +        final Logger logger;
  +
  +        try
  +        { 
  +            logger = getHierarchy().getLoggerFor( name );
  +        }
  +        catch( Throwable e )
  +        {
  +            throw new RuntimeException( "Bad category: " + path + " or trans: " + name );
  +        }
  +
           if( priority != null )
           {
               final Priority priorityValue = Priority.getPriorityForName( priority );
  @@ -375,13 +425,24 @@
           if( notify && getLogger().isInfoEnabled() )
           {
               final String message =
  -                REZ.getString( "category-create", path, target, logger.getPriority() );
  +                REZ.getString( "category-create", name, target, logger.getPriority() );
               getLogger().info( message );
           }
   
           return logger;
       }
   
  +    private String filter( String name )
  +    {
  +        String path = name.replace('/','.');
  +        if( path.startsWith(".") )
  +        {
  +            path = path.substring( 1 );
  +            return filter( path );
  +        }
  +        return path;
  +    }
  +
       private void addTarget( TargetDescriptor target ) throws Exception
       {
           final String name = target.getName();
  @@ -422,10 +483,6 @@
   
       private Hierarchy getHierarchy()
       {
  -        if( m_parent != null )
  -        {
  -            return m_parent.getHierarchy();
  -        }
           return m_logHierarchy;
       }
   
  
  
  
  1.1                  avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/logging/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  builder.redundent-role.notice=Warning: Type for class {0} redundently specifies role name "{1}" in dependency when it is identical to the name of service. It is recomended that the <role/> section be elided.
  builder.creating-info.notice=Creating a Type for class "{0}".
  builder.created-info.notice=Constructed Type object for class {0}. Type contains {1} services, {2} dependencies, {3} context entrys and {4} loggers.
  builder.bad-toplevel-element.error=Error the component implemented by "{0}" has an invalid element at top level of component info descriptor. Expected: "component-info". Actual: "{1}"
  builder.missing-info.error=Unable to locate resource from which to load info for component implemented by class "{0}".
  builder.missing-xml-creator.error=Unable to create XMLTypeCreator, usually due to not having XML classes on Classpath. Thus unable to lookup XML descriptor for component type "{0}".
  
  builder.creating-profile.notice=Creating Profiles for class "{0}".
  
  target.nocreate=Error creating LogTarget named "{0}" for file {0}. (Reason: {2}).
  unknown-priority=Unknown priority "{0}" for Logger named "{1}".
  category-create=Creating a log category named "{0}" that writes to "{1}" target at priority "{2}".
  
  missing.extension=Unable to locate an extension that is required by application.\n  Extension Name: {0}\n  Specification Vendor: {1}\n  Specification Version: {2}\n  Implementation Vendor: {3}\n  Implementation Vendor-Id: {4}\n  Implementation Version: {5}\n  Implementation URL: {6}
  unsatisfied.extensions=Missing {0} extensions and thus can not build ClassLoader for application.
  bad-classpath-entry=There is a bad entry ("{0}") on classpath that made it impossible to load a manifest.
  available-extensions=Available extensions: {0}
  required-extensions=The list of required extensions for application includes: {0}
  optional-packages-added=The list of "Optional Packages" added to the application include: {0}
  classpath-entries=The list of classpath entrys for the application include: {0}
  
  
  
  
  1.4       +5 -5      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/profile/DefaultProfileManager.java
  
  Index: DefaultProfileManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/profile/DefaultProfileManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultProfileManager.java	29 Nov 2002 13:04:56 -0000	1.3
  +++ DefaultProfileManager.java	3 Dec 2002 06:57:26 -0000	1.4
  @@ -137,12 +137,12 @@
       *     <td>key</td><td>type</td><td>default</td>
       *   </tr>
       *   <tr>
  -    *     <td>avalon:type.classloader</td>
  +    *     <td>urn:avalon:type.classloader</td>
       *     <td>java.lang.ClassLoader</td>
       *     <td>The context classloader will be used by default if not value is supplied.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:parent</td>
  +    *     <td>urn:assembly:parent</td>
       *     <td>{@link org.apache.avalon.assembly.profile.ProfileManager}</td>
       *     <td>In no value suppled, this manager will be considered as root.</td> 
       *   </tr>
  @@ -153,7 +153,7 @@
       {
           try
           {
  -            m_parent = (ProfileManager) context.get( "assembly:parent" );
  +            m_parent = (ProfileManager) context.get( "urn:assembly:parent" );
           }
           catch( ContextException e )
           {
  @@ -162,7 +162,7 @@
   
           try
           {
  -            m_classloader = (ClassLoader) context.get( "assembly:classloader" );
  +            m_classloader = (ClassLoader) context.get( "urn:assembly:classloader" );
           }
           catch( ContextException e )
           {
  
  
  
  1.2       +2 -2      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/profile/ProfileSelector.java
  
  Index: ProfileSelector.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/profile/ProfileSelector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProfileSelector.java	24 Nov 2002 12:50:45 -0000	1.1
  +++ ProfileSelector.java	3 Dec 2002 06:57:26 -0000	1.2
  @@ -60,7 +60,7 @@
    * candidate service providers in an autom assembly process.  A selector my be
    * declared via inclusion a implemetation class nameed <code>&lt;service-type&gt;Selector</code>.
    * Alternatively, a component author may declare a selection class explicitly via a
  - * service dependency attribute with the attribute name of <code>avalon:service.selector</code>.
  + * service dependency attribute with the attribute name of <code>urn:avalon:service.selector</code>.
    *
    * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
  
  
  
  1.2       +5 -5      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/service/DefaultServiceManager.java
  
  Index: DefaultServiceManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/service/DefaultServiceManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultServiceManager.java	24 Nov 2002 12:50:45 -0000	1.1
  +++ DefaultServiceManager.java	3 Dec 2002 06:57:26 -0000	1.2
  @@ -118,12 +118,12 @@
       *     <td>key</td><td>type</td><td>default</td>
       *   </tr>
       *   <tr>
  -    *     <td>avalon:type.classloader</td>
  +    *     <td>urn:avalon:type.classloader</td>
       *     <td>java.lang.ClassLoader</td>
       *     <td>The context classloader will be used by default if not value is supplied.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:parent</td>
  +    *     <td>urn:assembly:parent</td>
       *     <td>org.apache.avalon.assembly.service.ServiceManager</td>
       *     <td>In no value suppled, this service manager will be considered as a root manager.</td> 
       *   </tr>
  @@ -139,7 +139,7 @@
   
           try
           {
  -            m_parent = (ServiceManager) context.get( "assembly:parent" );
  +            m_parent = (ServiceManager) context.get( "urn:assembly:parent" );
           }
           catch( ContextException e )
           {
  @@ -148,7 +148,7 @@
   
           try
           {
  -            m_classloader = (ClassLoader) context.get( "assembly:classloader" );
  +            m_classloader = (ClassLoader) context.get( "urn:assembly:classloader" );
           }
           catch( ContextException e )
           {
  
  
  
  1.2       +7 -7      avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/type/DefaultTypeManager.java
  
  Index: DefaultTypeManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/type/DefaultTypeManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultTypeManager.java	24 Nov 2002 12:50:46 -0000	1.1
  +++ DefaultTypeManager.java	3 Dec 2002 06:57:26 -0000	1.2
  @@ -128,12 +128,12 @@
       *     <td>key</td><td>type</td><td>default</td>
       *   </tr>
       *   <tr>
  -    *     <td>avalon:type.classloader</td>
  +    *     <td>urn:avalon:type.classloader</td>
       *     <td>java.lang.ClassLoader</td>
       *     <td>The context classloader will be used by default if not value is supplied.</td> 
       *   </tr>
       *   <tr>
  -    *     <td>assembly:parent</td>
  +    *     <td>urn:assembly:parent</td>
       *     <td>{@link org.apache.avalon.assembly.type.TypeManager}</td>
       *     <td>In no value suppled, this type manager will be considered as a root manager.</td> 
       *   </tr>
  @@ -144,7 +144,7 @@
       {
           try
           {
  -            m_parent = (TypeManager) context.get( "assembly:parent" );
  +            m_parent = (TypeManager) context.get( "urn:assembly:parent" );
           }
           catch( ContextException e )
           {
  @@ -153,7 +153,7 @@
   
           try
           {
  -            m_classloader = (ClassLoader) context.get( "assembly:classloader" );
  +            m_classloader = (ClassLoader) context.get( "urn:assembly:classloader" );
           }
           catch( ContextException e )
           {
  @@ -467,8 +467,8 @@
           {
               ServiceDescriptor service = services[ i ];
               if( ( service.getAttribute( 
  -              "avalon:service.protocol", "native" ).equals( "native" ) )
  -              && ( service.getAttribute( "avalon:service.accessor", null ) == null ) )
  +              "urn:avalon:service.protocol", "native" ).equals( "native" ) )
  +              && ( service.getAttribute( "urn:avalon:service.accessor", null ) == null ) )
               {
                   list.add( getServiceClass( services[ i ] ) );
               }
  
  
  
  1.3       +18 -3     avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/TestCaseBase.java
  
  Index: TestCaseBase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/TestCaseBase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestCaseBase.java	29 Nov 2002 13:04:56 -0000	1.2
  +++ TestCaseBase.java	3 Dec 2002 06:57:27 -0000	1.3
  @@ -14,7 +14,10 @@
   import org.apache.avalon.assembly.logging.TargetDescriptor;
   import org.apache.avalon.assembly.logging.LoggingDescriptor;
   import org.apache.avalon.assembly.logging.DefaultLoggingManager;
  -import org.apache.avalon.framework.logger.*;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.context.DefaultContext;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.meta.model.Category;
   
   /**
  @@ -36,11 +39,23 @@
       protected void setUp() throws Exception
       {
           m_loader = Thread.currentThread().getContextClassLoader();
  +
           final File base = new File( System.getProperty( "user.dir" ) );
           LoggingDescriptor logging = 
              new LoggingDescriptor( 
  -             "", "DEBUG", null, new TargetDescriptor[ 0 ], new Category( "logging" ) );
  -        m_logManager = new DefaultLoggingManager( logging, base );
  +             "", "DEBUG", null, 
  +             new TargetDescriptor[ 0 ], 
  +             new Category( "logging" ) );
  +
  +        DefaultContext context = new DefaultContext();
  +        context.put( "urn:avalon:home", base );
  +        context.put( "urn:assembly:logging.descriptor", logging );
  +
  +        DefaultLoggingManager manager = new DefaultLoggingManager();
  +        manager.contextualize( context );
  +        manager.initialize();
  +
  +        m_logManager = manager;
       }
   
       protected Logger getLogger()
  
  
  
  1.3       +12 -5     avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/engine/EngineTestCase.java
  
  Index: EngineTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/engine/EngineTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EngineTestCase.java	30 Nov 2002 14:47:51 -0000	1.2
  +++ EngineTestCase.java	3 Dec 2002 06:57:27 -0000	1.3
  @@ -11,13 +11,15 @@
   import java.io.File;
   import junit.framework.TestCase;
   import org.apache.avalon.framework.Version;
  -import org.apache.avalon.framework.context.*;
  -import org.apache.avalon.framework.logger.*;
  -import org.apache.avalon.assembly.service.*;
  -import org.apache.avalon.assembly.type.*;
  +import org.apache.avalon.framework.context.DefaultContext;
  +import org.apache.avalon.framework.service.DefaultServiceManager;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.assembly.type.TypeManager;
  +import org.apache.avalon.assembly.type.DefaultTypeManager;
   import org.apache.avalon.meta.info.*;
   import org.apache.avalon.assembly.TestCaseBase;
  -import org.apache.avalon.assembly.engine.*;
  +import org.apache.avalon.assembly.engine.Engine;
  +import org.apache.avalon.assembly.engine.DefaultEngine;
   import org.apache.avalon.assembly.appliance.*;
   import org.apache.avalon.assembly.util.ExceptionHelper;
   
  @@ -46,6 +48,11 @@
           super.setUp();
           DefaultEngine engine = new DefaultEngine();
           engine.enableLogging( getLogger() );
  +        DefaultServiceManager manager = new DefaultServiceManager();
  +        manager.put( "urn:assembly:logging.manager", m_logManager );
  +        manager.makeReadOnly();
  +        engine.service( manager );
  +        engine.contextualize( new DefaultContext() );
           engine.initialize();
           m_engine = engine;
       }
  
  
  
  1.5       +2 -2      avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/profile/ProfileManagerTestCase.java
  
  Index: ProfileManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/profile/ProfileManagerTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProfileManagerTestCase.java	26 Nov 2002 18:04:22 -0000	1.4
  +++ ProfileManagerTestCase.java	3 Dec 2002 06:57:27 -0000	1.5
  @@ -199,7 +199,7 @@
           DefaultTypeManager manager = new DefaultTypeManager();
           manager.enableLogging( getLogger().getChildLogger("types") );
           DefaultContext context = new DefaultContext();
  -        context.put( "assembly:classloader", m_loader );
  +        context.put( "urn:assembly:classloader", m_loader );
           context.makeReadOnly();
           manager.contextualize( context );
           manager.initialize();
  @@ -211,7 +211,7 @@
           DefaultProfileManager manager = new DefaultProfileManager();
           manager.enableLogging( getLogger().getChildLogger("profiles") );
           DefaultContext context = new DefaultContext();
  -        context.put( "assembly:classloader", m_loader );
  +        context.put( "urn:assembly:classloader", m_loader );
           context.makeReadOnly();
           manager.contextualize( context );
           manager.initialize();
  
  
  
  1.2       +1 -1      avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/service/DefaultServiceManagerTestCase.java
  
  Index: DefaultServiceManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/service/DefaultServiceManagerTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultServiceManagerTestCase.java	24 Nov 2002 12:50:46 -0000	1.1
  +++ DefaultServiceManagerTestCase.java	3 Dec 2002 06:57:27 -0000	1.2
  @@ -44,7 +44,7 @@
           DefaultServiceManager manager = new DefaultServiceManager();
           manager.enableLogging( getLogger().getChildLogger("services") );
           DefaultContext context = new DefaultContext();
  -        context.put( "assembly:classloader", m_loader );
  +        context.put( "urn:assembly:classloader", m_loader );
           context.makeReadOnly();
           manager.contextualize( context );
           manager.initialize();
  
  
  
  1.2       +1 -1      avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/type/TypeManagerTestCase.java
  
  Index: TypeManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/type/TypeManagerTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TypeManagerTestCase.java	24 Nov 2002 12:50:46 -0000	1.1
  +++ TypeManagerTestCase.java	3 Dec 2002 06:57:27 -0000	1.2
  @@ -43,7 +43,7 @@
           DefaultTypeManager manager = new DefaultTypeManager();
           manager.enableLogging( getLogger().getChildLogger("types") );
           DefaultContext context = new DefaultContext();
  -        context.put( "assembly:classloader", m_loader );
  +        context.put( "urn:assembly:classloader", m_loader );
           context.makeReadOnly();
           manager.contextualize( context );
           manager.initialize();
  
  
  
  1.2       +1 -1      avalon-sandbox/assembly/src/test/org/apache/avalon/playground/BasicComponent.xprofile
  
  Index: BasicComponent.xprofile
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/BasicComponent.xprofile,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasicComponent.xprofile	24 Nov 2002 12:50:46 -0000	1.1
  +++ BasicComponent.xprofile	3 Dec 2002 06:57:27 -0000	1.2
  @@ -21,7 +21,7 @@
    
      <component name="basic">
        <context class="org.apache.avalon.playground.BasicContext">
  -       <import key="home" name="avalon:home"/>
  +       <import key="home" name="urn:avalon:home"/>
          <entry key="location">Paris</entry>
        </context>
      </component>
  
  
  
  1.3       +2 -2      avalon-sandbox/assembly/src/test/org/apache/avalon/playground/BasicService.xservice
  
  Index: BasicService.xservice
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/BasicService.xservice,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicService.xservice	29 Nov 2002 16:12:02 -0000	1.2
  +++ BasicService.xservice	3 Dec 2002 06:57:27 -0000	1.3
  @@ -16,8 +16,8 @@
   <service>
     <version>1.1</version>
     <attributes>
  -    <attribute key="avalon:service.name" value="basic"/>
  -    <attribute key="avalon:service.description">
  +    <attribute key="urn:avalon:service.name" value="basic"/>
  +    <attribute key="urn:avalon:service.description">
         A demonstration service used within the scope of the 
         Avalon playground package for educational and unit 
         testing purposes.
  
  
  
  1.2       +1 -1      avalon-sandbox/assembly/src/test/org/apache/avalon/playground/DemoManager.xinfo
  
  Index: DemoManager.xinfo
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/DemoManager.xinfo,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DemoManager.xinfo	24 Nov 2002 12:50:46 -0000	1.1
  +++ DemoManager.xinfo	3 Dec 2002 06:57:27 -0000	1.2
  @@ -23,7 +23,7 @@
     <info>
       <name>demonstratable</name>
       <attributes>
  -      <attribute key="avalon:lifestyle" value="thread"/>
  +      <attribute key="urn:avalon:lifestyle" value="thread"/>
       </attributes>
     </info>
   
  
  
  
  1.2       +1 -1      avalon-sandbox/assembly/src/test/org/apache/avalon/playground/SimpleComponent.xinfo
  
  Index: SimpleComponent.xinfo
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/SimpleComponent.xinfo,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleComponent.xinfo	24 Nov 2002 12:50:46 -0000	1.1
  +++ SimpleComponent.xinfo	3 Dec 2002 06:57:27 -0000	1.2
  @@ -22,7 +22,7 @@
     <services>
       <service>
         <attributes>
  -        <attribute key="avalon:service.servlet" 
  +        <attribute key="urn:avalon:service.servlet" 
             value="simple.jsp"/>
         </attributes> 
         <reference type="org.apache.avalon.playground.SimpleService"/>
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message