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/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl DefaultKernel.java
Date Sat, 14 Jun 2003 11:02:24 GMT
mcconnell    2003/06/14 04:02:24

  Modified:    merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl
                        DefaultKernel.java
  Log:
  Context reference and logging enhancement.
  
  Revision  Changes    Path
  1.20      +22 -10    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultKernel.java	12 Jun 2003 18:56:20 -0000	1.19
  +++ DefaultKernel.java	14 Jun 2003 11:02:24 -0000	1.20
  @@ -54,16 +54,19 @@
   import java.net.URL;
   import java.util.ArrayList;
   
  +import org.apache.avalon.assembly.appliance.Appliance;
   import org.apache.avalon.assembly.appliance.DependencyGraph;
  +import org.apache.avalon.assembly.engine.Engine;
   import org.apache.avalon.assembly.locator.Contextualizable;
   import org.apache.avalon.assembly.locator.Locator;
   import org.apache.avalon.assembly.locator.impl.DefaultLocator;
  +import org.apache.avalon.assembly.logging.impl.DefaultLoggingManager;
   import org.apache.avalon.assembly.logging.LoggingDescriptor;
   import org.apache.avalon.assembly.logging.LoggingManager;
  +import org.apache.avalon.assembly.logging.impl.FileTargetProvider;
  +import org.apache.avalon.assembly.logging.LoggingDescriptor;
   import org.apache.avalon.assembly.logging.TargetDescriptor;
   import org.apache.avalon.assembly.logging.TargetProvider;
  -import org.apache.avalon.assembly.logging.impl.DefaultLoggingManager;
  -import org.apache.avalon.assembly.logging.impl.FileTargetProvider;
   import org.apache.avalon.assembly.repository.Repository;
   import org.apache.avalon.assembly.repository.impl.FileRepository;
   import org.apache.avalon.assembly.util.ExceptionHelper;
  @@ -80,12 +83,12 @@
   import org.apache.avalon.merlin.block.Block;
   import org.apache.avalon.merlin.block.impl.StandardBlockLoader;
   import org.apache.avalon.merlin.container.Container;
  +import org.apache.avalon.meta.model.builder.XMLProfileCreator;
   import org.apache.avalon.merlin.kernel.Kernel;
   import org.apache.avalon.merlin.kernel.KernelException;
   import org.apache.avalon.merlin.kernel.KernelLoader;
   import org.apache.avalon.meta.model.Category;
   import org.apache.avalon.meta.model.LoggingDirective;
  -import org.apache.avalon.meta.model.builder.XMLProfileCreator;
   import org.apache.excalibur.event.command.CommandManager;
   import org.apache.excalibur.event.command.TPCThreadManager;
   import org.apache.excalibur.mpool.DefaultPoolManager;
  @@ -238,6 +241,7 @@
       */
       private Repository m_repository;
   
  +
       //==============================================================
       // Contextualizable
       //==============================================================
  @@ -469,13 +473,13 @@
   
               DefaultLocator context = new DefaultLocator();
               context.put( Repository.KEY, m_repository );
  +            context.put( Engine.DOMAIN_KEY, m_domain );
               context.put( "urn:assembly:system", m_root );
               context.put( "urn:merlin:home", m_home );
               context.put( "urn:merlin:logging-manager", m_logging );
               context.put( "urn:merlin:pool-manager", m_pool );
               context.put( "urn:merlin:classloader.system", m_loader );
               context.put( "urn:merlin:classloader.common", m_common );
  -            context.put( "urn:merlin:domain", m_domain );
               if( m_base != null ) 
               {
                   context.put( KernelLoader.BASE_KEY, m_base );
  @@ -502,6 +506,11 @@
           // install the root block
           //
   
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "" );
  +        }
  +
           try
           {
               m_block = install( m_url, m_override );
  @@ -660,11 +669,15 @@
               }
           }
   
  -        if( getLogger().isInfoEnabled() )
  +        if( getLogger().isDebugEnabled() )
           {
               int n = Thread.activeCount();
               getLogger().info( "bye (" + n + ")" );
           }
  +        else if( getLogger().isInfoEnabled() )
  +        {
  +            getLogger().info( "bye" );
  +        }
       }
   
       //==============================================================
  @@ -706,9 +719,9 @@
                   m_config.getChild( "logging" ), root, level );
   
               DefaultLocator context = new DefaultLocator();
  -            context.put( "urn:assembly:home", m_home );
  -            context.put( "urn:assembly:logging.descriptor", descriptor );
  +            context.put( Appliance.APPLIANCE_HOME_KEY, m_home );
               context.put( LoggingManager.SYSTEM_CATEGORY_KEY, system );
  +            context.put( "urn:assembly:logging.descriptor", descriptor );
               context.makeReadOnly();
   
               logging.contextualize( context );
  @@ -751,8 +764,8 @@
           if( m_system == null )
           {
               DefaultLocator context = new DefaultLocator();
  -            context.put( "urn:assembly:home", m_home );
  -            context.put( "urn:merlin:domain", m_domain );
  +            context.put( Engine.DOMAIN_KEY, m_domain );
  +            context.put( Appliance.APPLIANCE_HOME_KEY, m_home );
               context.makeReadOnly();
               m_system = context;
           }
  @@ -892,5 +905,4 @@
           String file = config.getAttribute( "location" );
           return new FileTargetProvider( file );
       }
  -
   }
  
  
  

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


Mime
View raw message