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/src/java/org/apache/avalon/merlin/kernel DefaultKernel.java
Date Thu, 09 Jan 2003 11:26:25 GMT
mcconnell    2003/01/09 03:26:25

  Modified:    merlin/src/java/org/apache/avalon/merlin/block Block.java
                        DefaultBlock.java
               merlin/src/java/org/apache/avalon/merlin/container
                        ContainerLoader.java
               merlin/src/java/org/apache/avalon/merlin/kernel
                        DefaultKernel.java
  Log:
  Updates to sync with seperation of appliance factory concerns from the classloader implementation.
  
  Revision  Changes    Path
  1.7       +1 -2      avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/Block.java
  
  Index: Block.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/Block.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Block.java	9 Jan 2003 03:59:39 -0000	1.6
  +++ Block.java	9 Jan 2003 11:26:25 -0000	1.7
  @@ -62,7 +62,6 @@
    * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -//public interface Block extends Appliance, Container
   public interface Block extends Appliance
   {
       static final String AVALON_BLOCK_KEY = "Avalon-Block";
  
  
  
  1.12      +30 -10    avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/DefaultBlock.java
  
  Index: DefaultBlock.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/DefaultBlock.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DefaultBlock.java	9 Jan 2003 03:59:39 -0000	1.11
  +++ DefaultBlock.java	9 Jan 2003 11:26:25 -0000	1.12
  @@ -18,6 +18,8 @@
   import org.apache.avalon.assembly.appliance.ApplianceContext;
   import org.apache.avalon.assembly.appliance.ApplianceException;
   import org.apache.avalon.assembly.engine.EngineClassLoader;
  +import org.apache.avalon.assembly.locator.Locator;
  +import org.apache.avalon.assembly.locator.Contextualizable;
   import org.apache.avalon.assembly.lifestyle.LifestyleException;
   import org.apache.avalon.assembly.lifestyle.LifestyleService;
   import org.apache.avalon.assembly.lifecycle.AssemblyService;
  @@ -27,7 +29,6 @@
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -92,6 +93,8 @@
       // state
       //-------------------------------------------------------------------------------
   
  +    EngineClassLoader m_engine;
  +
      /**
       * The root container instance that this block is managing.
       */
  @@ -131,18 +134,35 @@
        */
       private BlockException m_error;
   
  -    //-------------------------------------------------------------------------------
  -    // constructor
  -    //-------------------------------------------------------------------------------
   
  -    public DefaultBlock( 
  -      EngineClassLoader engine, LifestyleService lifestyle, AssemblyService assembly, 
  -      ApplianceContext context, Context system, Logger logger )
  -      throws ApplianceException
  +    //=====================================================================
  +    // Contextualizable
  +    //=====================================================================
  +
  +   /**
  +    * Supply a object locator to the instance.
  +    * @param locator the object locator
  +    * @exception LocatorException if a object location error occurs
  +    */
  +    public void contextualize( Locator context ) throws ContextException
  +    {
  +        super.contextualize( context );
  +        m_engine = (EngineClassLoader) context.get( "urn:assembly:engine" );
  +    }
  +
  +    //=====================================================================
  +    // Initializable
  +    //=====================================================================
  +
  +    public void initialize() throws Exception
       {
  -        super( engine, lifestyle, assembly, context, system, logger );
  +        super.initialize();
  +        if( m_engine == null )
  +        {
  +            throw new IllegalStateException( "context" );
  +        }
           m_thread = new Thread( this, super.getPath() );
  -        m_thread.setContextClassLoader( engine );
  +        m_thread.setContextClassLoader( m_engine );
           m_thread.start();
       }
   
  
  
  
  1.9       +1 -2      avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/container/ContainerLoader.java
  
  Index: ContainerLoader.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/container/ContainerLoader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ContainerLoader.java	27 Dec 2002 16:42:27 -0000	1.8
  +++ ContainerLoader.java	9 Jan 2003 11:26:25 -0000	1.9
  @@ -214,7 +214,6 @@
                   engine = new EngineClassLoader( parent );
               }
               engine.enableLogging( logger.getChildLogger( "engine" ) );
  -            engine.configure( config );
               DefaultContext context = new DefaultContext();
               context.put( "urn:assembly:home", home );
               context.put( "urn:assembly:engine.extensions", extensions );
  
  
  
  1.24      +2 -13     avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel/DefaultKernel.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DefaultKernel.java	8 Jan 2003 23:03:29 -0000	1.23
  +++ DefaultKernel.java	9 Jan 2003 11:26:25 -0000	1.24
  @@ -935,25 +935,14 @@
           {
               EngineClassLoader engine = new EngineClassLoader( m_bootstrap );
               engine.enableLogging( getLogger().getChildLogger( "engine" ) );
  -
  -            //
  -            // configuration of the engine should be removed with a preference for 
  -            // creating the resources that the engine needs and supplying the 
  -            // resources
  -            //
  -
  -            engine.configure( config );
               Context system = getSystemContext();
               DefaultContext context = new DefaultContext( system );
               context.put( "urn:assembly:engine.bootstrap", "true" );
               context.put( "urn:assembly:engine.extensions", extensions );
               context.put( "urn:assembly:engine.classpath", classpath );
  +            context.put( "urn:assembly:logging.manager", logging );
               context.makeReadOnly();
               engine.contextualize( context );
  -            DefaultServiceManager manager = new DefaultServiceManager();
  -            manager.put( "urn:assembly:logging.manager", logging );
  -            manager.makeReadOnly();
  -            engine.service( manager );
               engine.initialize();
               return engine;
           }
  
  
  

--
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