avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon/merlin/platform/tutorials/lifecycle/activation/src/java/tutorial DemonstratableProvider.java
Date Sun, 04 Jan 2004 17:23:17 GMT
mcconnell    2004/01/04 09:23:17

  Modified:    merlin/activation/api/src/java/org/apache/avalon/activation/lifecycle
                        Tag: Ver_3_4 LifecycleCreateExtension.java
                        LifecycleDestroyExtension.java
               merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl
                        Tag: Ver_3_4 AbstractBlock.java
                        DefaultAppliance.java
               merlin/activation/impl/src/java/org/apache/avalon/activation/lifestyle/impl
                        Tag: Ver_3_4 AbstractLifestyleHandler.java
                        TransientLifestyleHandler.java
               merlin/activation/spi/src/java/org/apache/avalon/activation/lifecycle
                        Tag: Ver_3_4 Factory.java
               merlin/composition/api/src/java/org/apache/avalon/composition/model
                        Tag: Ver_3_4 ContainmentModel.java
                        DependencyGraph.java Model.java ModelFactory.java
               merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        Tag: Ver_3_4 DefaultConstructorModel.java
                        DefaultContainmentModel.java DefaultContext.java
                        DefaultContextModel.java DefaultImportModel.java
                        DefaultModelFactory.java Resources.properties
               merlin/composition/impl/src/test/org/apache/avalon/composition/model/test
                        Tag: Ver_3_4 AssemblyTestCase.java
                        ContextTestCase.java DependencyTestCase.java
                        TargetsTestCase.java
               merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl
                        Tag: Ver_3_4 DefaultFactory.java DefaultKernel.java
               merlin/platform/tutorials/lifecycle/activation/src/java/tutorial
                        Tag: Ver_3_4 DemonstratableProvider.java
  Added:       merlin/composition/api/src/java/org/apache/avalon/composition/model
                        Tag: Ver_3_4 ComponentContext.java
                        ComponentModel.java ComponentModelFactory.java
               merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        Tag: Ver_3_4 DefaultComponentContext.java
                        DefaultComponentModel.java
  Removed:     merlin/composition/api/src/java/org/apache/avalon/composition/model
                        Tag: Ver_3_4 Composite.java DeploymentContext.java
                        DeploymentModel.java DeploymentModelFactory.java
               merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        Tag: Ver_3_4 DefaultDeploymentContext.java
                        DefaultDeploymentModel.java NullComponent.java
                        NullComponent.xinfo
  Log:
  Rename DeploymentModel to ComponentModel and DeploymentContext to ComponentContext
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.1.1.2.1 +2 -2      avalon/merlin/activation/api/src/java/org/apache/avalon/activation/lifecycle/LifecycleCreateExtension.java
  
  Index: LifecycleCreateExtension.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/api/src/java/org/apache/avalon/activation/lifecycle/LifecycleCreateExtension.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- LifecycleCreateExtension.java	24 Sep 2003 09:30:22 -0000	1.1.1.1
  +++ LifecycleCreateExtension.java	4 Jan 2004 17:23:16 -0000	1.1.1.1.2.1
  @@ -51,7 +51,7 @@
   
   package org.apache.avalon.activation.lifecycle;
   
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.meta.info.StageDescriptor;
   
   public interface LifecycleCreateExtension
  @@ -63,7 +63,7 @@
        * @param object the object under deployment
        * @exception if a deployment error occurs
        */
  -     public void create( DeploymentModel model, StageDescriptor stage, Object object)
  +     public void create( ComponentModel model, StageDescriptor stage, Object object)
          throws Exception;
   
   }
  
  
  
  1.1.1.1.2.1 +2 -2      avalon/merlin/activation/api/src/java/org/apache/avalon/activation/lifecycle/LifecycleDestroyExtension.java
  
  Index: LifecycleDestroyExtension.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/api/src/java/org/apache/avalon/activation/lifecycle/LifecycleDestroyExtension.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- LifecycleDestroyExtension.java	24 Sep 2003 09:30:22 -0000	1.1.1.1
  +++ LifecycleDestroyExtension.java	4 Jan 2004 17:23:16 -0000	1.1.1.1.2.1
  @@ -51,7 +51,7 @@
   
   package org.apache.avalon.activation.lifecycle;
   
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.meta.info.StageDescriptor;
   
   public interface LifecycleDestroyExtension
  @@ -63,6 +63,6 @@
        * @param object the object under deployment
        * @exception if a deployment error occurs
        */
  -     public void destroy( DeploymentModel model, StageDescriptor stage, Object object)
  +     public void destroy( ComponentModel model, StageDescriptor stage, Object object)
          throws Exception;
   }
  
  
  
  No                   revision
  No                   revision
  1.10.2.1  +4 -4      avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/AbstractBlock.java
  
  Index: AbstractBlock.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/AbstractBlock.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- AbstractBlock.java	1 Jan 2004 13:05:05 -0000	1.10
  +++ AbstractBlock.java	4 Jan 2004 17:23:16 -0000	1.10.2.1
  @@ -73,7 +73,7 @@
   import org.apache.avalon.composition.event.CompositionEventListener;
   import org.apache.avalon.composition.model.ContainmentModel;
   import org.apache.avalon.composition.model.DependencyModel;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.Model;
   import org.apache.avalon.composition.model.StageModel;
   import org.apache.avalon.framework.activity.Disposable;
  @@ -915,10 +915,10 @@
           final LoggingManager logging = services.getLoggingManager();
           final DependencyGraph graph = m_context.getDependencyGraph();
   
  -        if( model instanceof DeploymentModel )
  +        if( model instanceof ComponentModel )
           {
               getLogger().debug( "creating appliance: " + path );
  -            DeploymentModel deployment = (DeploymentModel) model;
  +            ComponentModel deployment = (ComponentModel) model;
               CategoriesDirective categories = deployment.getCategories();
               if( categories != null )
               {
  
  
  
  1.15.2.1  +11 -11    avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java
  
  Index: DefaultAppliance.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- DefaultAppliance.java	22 Dec 2003 21:28:09 -0000	1.15
  +++ DefaultAppliance.java	4 Jan 2004 17:23:16 -0000	1.15.2.1
  @@ -78,7 +78,7 @@
   import org.apache.avalon.composition.logging.LoggingManager;
   import org.apache.avalon.composition.model.ContextModel;
   import org.apache.avalon.composition.model.DependencyModel;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.StageModel;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  @@ -134,7 +134,7 @@
      /**
       * The deployment model characterizing this appliance instance.
       */
  -    private final DeploymentModel m_model;
  +    private final ComponentModel m_model;
   
      /**
       * The engine from which we resolve dependent appliances during asembly.
  @@ -195,13 +195,13 @@
       //-------------------------------------------------------------------
   
       public DefaultAppliance( 
  -      Logger logger, ServiceContext context, DeploymentModel model, Engine engine )
  +      Logger logger, ServiceContext context, ComponentModel model, Engine engine )
       {
           super( logger.getChildLogger( "appliance" ), model );
   
           m_logger = logger;
           m_context = context;
  -        m_model = (DeploymentModel) model;
  +        m_model = (ComponentModel) model;
           m_engine = engine;
       }
   
  @@ -323,8 +323,8 @@
                       // interface
                       //
   
  -                    DeploymentModel model = 
  -                       (DeploymentModel) m_contextProvider.getModel();
  +                    ComponentModel model = 
  +                       (ComponentModel) m_contextProvider.getModel();
                       Class handler = 
                         model.getDeploymentClass();
   
  @@ -814,7 +814,7 @@
               // TODO: add operation to Appliance interface so that we can 
               // verify assignability
    
  -            Class c = ((DeploymentModel)provider.getModel()).getDeploymentClass();
  +            Class c = ((ComponentModel)provider.getModel()).getDeploymentClass();
               getLogger().debug( "processing create: " + c.getName() 
                 + ", [" +  Creator.class.isAssignableFrom( c ) + "]" );
   
  @@ -926,7 +926,7 @@
               // verify assignability
               //
   
  -            Class c = ((DeploymentModel)provider.getModel()).getDeploymentClass();
  +            Class c = ((ComponentModel)provider.getModel()).getDeploymentClass();
               if( Accessor.class.isAssignableFrom( c ) )
               {
                   Accessor handler = (Accessor) provider.resolve();
  @@ -1086,7 +1086,7 @@
       }
   
       private Logger getTargetLogger( 
  -      LoggingManager logging, DeploymentModel model )
  +      LoggingManager logging, ComponentModel model )
       {
           if( LogEnabled.class.isAssignableFrom( model.getDeploymentClass() ) )
           {
  @@ -1288,7 +1288,7 @@
           *
           * @exception LifecycleException
           */
  -        public DeploymentModel getDeploymentModel()
  +        public ComponentModel getComponentModel()
           {
               return m_model;
           }
  
  
  
  No                   revision
  No                   revision
  1.6.2.1   +2 -2      avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/lifestyle/impl/AbstractLifestyleHandler.java
  
  Index: AbstractLifestyleHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/lifestyle/impl/AbstractLifestyleHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- AbstractLifestyleHandler.java	14 Dec 2003 14:09:59 -0000	1.6
  +++ AbstractLifestyleHandler.java	4 Jan 2004 17:23:16 -0000	1.6.2.1
  @@ -104,7 +104,7 @@
   
       Reference getReference( Object instance )
       {
  -        final int policy = getFactory().getDeploymentModel().getCollectionPolicy();
  +        final int policy = getFactory().getComponentModel().getCollectionPolicy();
           if( policy == InfoDescriptor.LIBERAL )
           {
                return new WeakReference( instance, m_liberals );
  
  
  
  1.6.2.1   +2 -2      avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/lifestyle/impl/TransientLifestyleHandler.java
  
  Index: TransientLifestyleHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/lifestyle/impl/TransientLifestyleHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- TransientLifestyleHandler.java	14 Dec 2003 14:09:59 -0000	1.6
  +++ TransientLifestyleHandler.java	4 Jan 2004 17:23:16 -0000	1.6.2.1
  @@ -125,7 +125,7 @@
       */
       Reference getReference( Object instance )
       {
  -        final int policy = getFactory().getDeploymentModel().getCollectionPolicy();
  +        final int policy = getFactory().getComponentModel().getCollectionPolicy();
           if( policy == InfoDescriptor.DEMOCRAT )
           {
                return new SoftReference( instance );
  
  
  
  No                   revision
  No                   revision
  1.2.2.1   +3 -3      avalon/merlin/activation/spi/src/java/org/apache/avalon/activation/lifecycle/Factory.java
  
  Index: Factory.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/spi/src/java/org/apache/avalon/activation/lifecycle/Factory.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- Factory.java	17 Oct 2003 06:44:49 -0000	1.2
  +++ Factory.java	4 Jan 2004 17:23:16 -0000	1.2.2.1
  @@ -51,7 +51,7 @@
   package org.apache.avalon.activation.lifecycle;
   
   import org.apache.avalon.activation.lifecycle.LifecycleException;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   
   /**
    * The Factory interface exposes an operation though which a 
  @@ -67,7 +67,7 @@
       *
       * @exception LifecycleException
       */
  -    DeploymentModel getDeploymentModel();
  +    ComponentModel getComponentModel();
   
      /**
       * Create a new instance of a component. 
  
  
  
  No                   revision
  No                   revision
  1.9.2.3   +2 -2      avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/ContainmentModel.java
  
  Index: ContainmentModel.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/ContainmentModel.java,v
  retrieving revision 1.9.2.2
  retrieving revision 1.9.2.3
  diff -u -r1.9.2.2 -r1.9.2.3
  --- ContainmentModel.java	3 Jan 2004 23:18:55 -0000	1.9.2.2
  +++ ContainmentModel.java	4 Jan 2004 17:23:16 -0000	1.9.2.3
  @@ -68,7 +68,7 @@
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public interface ContainmentModel extends Model, Composite
  +public interface ContainmentModel extends Model
   {
       public static String SEPERATOR = "/";
   
  
  
  
  1.1.2.2   +9 -15     avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/Attic/DependencyGraph.java
  
  Index: DependencyGraph.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/Attic/DependencyGraph.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- DependencyGraph.java	3 Jan 2004 22:08:21 -0000	1.1.2.1
  +++ DependencyGraph.java	4 Jan 2004 17:23:16 -0000	1.1.2.2
  @@ -341,13 +341,10 @@
               final ArrayList done,
               final ArrayList order )
       {
  -        if( model instanceof Composite )
  +        Model[] providers = model.getProviders();
  +        for( int i = (providers.length - 1); i > -1; i-- )
           {
  -            Model[] providers = ((Composite)model).getProviders();
  -            for( int i = (providers.length - 1); i > -1; i-- )
  -            {
  -                visitcomponent( providers[i], true, done, order );
  -            }
  +            visitcomponent( providers[i], true, done, order );
           }
       }
   
  @@ -370,16 +367,13 @@
               final Model other =
                       (Model) m_models.get( i );
   
  -            if( model instanceof Composite )
  +            final Model[] providers = other.getProviders();
  +            for( int j = 0; j < providers.length; j++ )
               {
  -                final Model[] providers = ((Composite)other).getProviders();
  -                for( int j = 0; j < providers.length; j++ )
  +                Model provider = providers[j];
  +                if( provider.equals( model ) )
                   {
  -                    Model provider = providers[j];
  -                    if( provider.equals( model ) )
  -                    {
  -                        visitcomponent( other, false, done, order );
  -                    }
  +                    visitcomponent( other, false, done, order );
                   }
               }
           }
  
  
  
  1.1.1.1.2.1 +43 -1     avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/Model.java
  
  Index: Model.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/Model.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- Model.java	24 Sep 2003 09:31:18 -0000	1.1.1.1
  +++ Model.java	4 Jan 2004 17:23:16 -0000	1.1.1.1.2.1
  @@ -115,4 +115,46 @@
       */
       boolean isaCandidate( StageDescriptor stage );
   
  +    //-----------------------------------------------------------
  +    // composite assembly
  +    //-----------------------------------------------------------
  +
  +    /**
  +     * Returns the assembled state of the model.
  +     * @return true if this model is assembled
  +     */
  +    boolean isAssembled();
  +
  +    /**
  +     * Assemble the model.
  +     * @exception Exception if an error occurs during model assembly
  +     */
  +    void assemble() throws AssemblyException;
  +
  +   /**
  +    * Return the set of models consuming this model.
  +    * @return the consumers
  +    */
  +    Model[] getConsumerGraph();
  +
  +   /**
  +    * Return the set of models supplying this model.
  +    * @return the providers
  +    */
  +    Model[] getProviderGraph();
  +
  +    /**
  +     * Disassemble the model.
  +     */
  +    void disassemble();
  +
  +    /**
  +     * Return the set of models assigned as providers.
  +     * @return the providers consumed by the model
  +     * @exception IllegalStateException if invoked prior to 
  +     *    the completion of the assembly phase 
  +     */
  +    Model[] getProviders();
  +
  +
   }
  
  
  
  1.2.2.1   +2 -2      avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/ModelFactory.java
  
  Index: ModelFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/ModelFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ModelFactory.java	28 Oct 2003 12:53:48 -0000	1.2
  +++ ModelFactory.java	4 Jan 2004 17:23:16 -0000	1.2.2.1
  @@ -110,7 +110,7 @@
       * @param context a potentially foreign deployment context
       * @return the deployment model
       */
  -    DeploymentModel createDeploymentModel( DeploymentContext context )
  +    ComponentModel createComponentModel( ComponentContext context )
         throws ModelException;
   
   }
  
  
  
  No                   revision
  
  Index: ModelFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/ModelFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ModelFactory.java	28 Oct 2003 12:53:48 -0000	1.2
  +++ ModelFactory.java	4 Jan 2004 17:23:16 -0000	1.2.2.1
  @@ -110,7 +110,7 @@
       * @param context a potentially foreign deployment context
       * @return the deployment model
       */
  -    DeploymentModel createDeploymentModel( DeploymentContext context )
  +    ComponentModel createComponentModel( ComponentContext context )
         throws ModelException;
   
   }
  
  
  
  No                   revision
  
  Index: ModelFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/ModelFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ModelFactory.java	28 Oct 2003 12:53:48 -0000	1.2
  +++ ModelFactory.java	4 Jan 2004 17:23:16 -0000	1.2.2.1
  @@ -110,7 +110,7 @@
       * @param context a potentially foreign deployment context
       * @return the deployment model
       */
  -    DeploymentModel createDeploymentModel( DeploymentContext context )
  +    ComponentModel createComponentModel( ComponentContext context )
         throws ModelException;
   
   }
  
  
  
  1.1.2.1   +185 -0    avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/Attic/ComponentContext.java
  
  
  
  
  1.1.2.1   +239 -0    avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/Attic/ComponentModel.java
  
  
  
  
  1.1.2.1   +78 -0     avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/Attic/ComponentModelFactory.java
  
  
  
  
  No                   revision
  No                   revision
  1.2.2.1   +4 -4      avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultConstructorModel.java
  
  Index: DefaultConstructorModel.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultConstructorModel.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- DefaultConstructorModel.java	28 Oct 2003 20:21:00 -0000	1.2
  +++ DefaultConstructorModel.java	4 Jan 2004 17:23:16 -0000	1.2.2.1
  @@ -54,7 +54,7 @@
   import java.util.Map;
   
   import org.apache.avalon.composition.model.ModelException;
  -import org.apache.avalon.composition.model.DeploymentContext;
  +import org.apache.avalon.composition.model.ComponentContext;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.context.ContextException;
  @@ -86,7 +86,7 @@
   
       private final EntryDescriptor m_descriptor;
   
  -    private final DeploymentContext m_context;
  +    private final ComponentContext m_context;
   
       private final Map m_map;
   
  @@ -110,7 +110,7 @@
       */
       public DefaultConstructorModel( 
         EntryDescriptor descriptor, ConstructorDirective directive, 
  -      DeploymentContext context, Map map ) throws ModelException
  +      ComponentContext context, Map map ) throws ModelException
       {
           super( descriptor );
   
  
  
  
  1.13.2.7  +23 -37    avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
  
  Index: DefaultContainmentModel.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java,v
  retrieving revision 1.13.2.6
  retrieving revision 1.13.2.7
  diff -u -r1.13.2.6 -r1.13.2.7
  --- DefaultContainmentModel.java	4 Jan 2004 01:19:28 -0000	1.13.2.6
  +++ DefaultContainmentModel.java	4 Jan 2004 17:23:16 -0000	1.13.2.7
  @@ -78,13 +78,12 @@
   import org.apache.avalon.composition.event.CompositionEvent;
   import org.apache.avalon.composition.event.CompositionEventListener;
   import org.apache.avalon.composition.model.AssemblyException;
  -import org.apache.avalon.composition.model.Composite;
   import org.apache.avalon.composition.model.ClassLoaderContext;
   import org.apache.avalon.composition.model.ClassLoaderModel;
   import org.apache.avalon.composition.model.ContainmentModel;
   import org.apache.avalon.composition.model.ContainmentContext;
   import org.apache.avalon.composition.model.DependencyGraph;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.Model;
   import org.apache.avalon.composition.model.ModelException;
   import org.apache.avalon.composition.model.ModelRuntimeException;
  @@ -261,10 +260,6 @@
           return false;
       }
   
  -    //--------------------------------------------------------------
  -    // Composite
  -    //--------------------------------------------------------------
  -
       /**
        * Returns the assembled state of the model.
        * @return true if this model is assembled
  @@ -292,10 +287,7 @@
               for( int i=0; i<models.length; i++ )
               {
                   Model model = models[i];
  -                if( model instanceof Composite )
  -                {
  -                    ((Composite)model).assemble();
  -                }
  +                model.assemble();
               }
   
               m_assembly.setEnabled( true );
  @@ -319,10 +311,7 @@
               for( int i=0; i<models.length; i++ )
               {
                   Model model = models[i];
  -                if( model instanceof Composite )
  -                {
  -                    ((Composite)model).disassemble();
  -                }
  +                model.disassemble();
               }
               m_assembly.setEnabled( false );
           }
  @@ -347,18 +336,15 @@
           for( int i=0; i<models.length; i++ )
           {
               Model model = models[i];
  -            if( model instanceof Composite )
  +            Model[] providers = model.getProviders();
  +            for( int j=0; j<providers.length; j++ )
               {
  -                Model[] providers = ((Composite)model).getProviders();
  -                for( int j=0; j<providers.length; j++ )
  +                Model provider = providers[j];
  +                final String path = provider.getPath();
  +                final String root = getPartition();
  +                if( !path.startsWith( root ) )
                   {
  -                    Model provider = providers[j];
  -                    final String path = provider.getPath();
  -                    final String root = getPartition();
  -                    if( !path.startsWith( root ) )
  -                    {
  -                        list.add( providers[j] );
  -                    }
  +                    list.add( providers[j] );
                   }
               }
           }
  @@ -464,13 +450,13 @@
           else if( profile instanceof DeploymentProfile ) 
           {
               DeploymentProfile deployment = (DeploymentProfile) profile;
  -            model = createDeploymentModel( deployment );
  +            model = createComponentModel( deployment );
           }
           else if( profile instanceof NamedDeploymentProfile ) 
           {
               DeploymentProfile deployment = 
                 createDeploymentProfile( (NamedDeploymentProfile) profile );
  -            model = createDeploymentModel( deployment );
  +            model = createComponentModel( deployment );
           }
           else if( profile instanceof BlockIncludeDirective ) 
           {
  @@ -594,7 +580,7 @@
       * @param profile a containment profile 
       * @return the composition model
       */
  -    private DeploymentModel createDeploymentModel( final DeploymentProfile profile ) 
  +    private ComponentModel createComponentModel( final DeploymentProfile profile ) 
         throws ModelException
       {
           if( null == profile ) 
  @@ -620,8 +606,8 @@
               final File home = new File( m_context.getHomeDirectory(), name );
               final File temp = new File( m_context.getTempDirectory(), name );
   
  -            DefaultDeploymentContext context = 
  -              new DefaultDeploymentContext( 
  +            DefaultComponentContext context = 
  +              new DefaultComponentContext( 
                   logger, name, m_context, profile, type, base, home, temp, partition );
   
               //
  @@ -630,7 +616,7 @@
               // the argument.
               //
   
  -            return new DefaultDeploymentModel( context );
  +            return new DefaultComponentModel( context );
           }
           catch( Throwable e )
           {
  @@ -790,9 +776,9 @@
               {
                   if( target.getConfiguration() != null )
                   {
  -                    if( child instanceof DeploymentModel )
  +                    if( child instanceof ComponentModel )
                       {
  -                        ((DeploymentModel)child).setConfiguration( 
  +                        ((ComponentModel)child).setConfiguration( 
                             target.getConfiguration() );
                       }
                       else if( child instanceof ContainmentModel )
  @@ -805,9 +791,9 @@
                   }
                   if( target.getCategoriesDirective() != null )
                   {
  -                    if( child instanceof DeploymentModel )
  +                    if( child instanceof ComponentModel )
                       {
  -                        ((DeploymentModel)child).setCategories( 
  +                        ((ComponentModel)child).setCategories( 
                              target.getCategoriesDirective() );
                       }
                       else if( child instanceof ContainmentModel )
  @@ -1336,9 +1322,9 @@
               Object model = getModel( path );
               if( model != null )
               {
  -                if( model instanceof DeploymentModel )
  +                if( model instanceof ComponentModel )
                   {
  -                    DeploymentModel deployment = (DeploymentModel) model;
  +                    ComponentModel deployment = (ComponentModel) model;
                       if( target.getConfiguration() != null )
                       {
                           deployment.setConfiguration( target.getConfiguration() );
  
  
  
  1.2.2.1   +4 -4      avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContext.java
  
  Index: DefaultContext.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContext.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- DefaultContext.java	28 Oct 2003 20:21:00 -0000	1.2
  +++ DefaultContext.java	4 Jan 2004 17:23:16 -0000	1.2.2.1
  @@ -50,7 +50,7 @@
   
   package org.apache.avalon.composition.model.impl;
   
  -import org.apache.avalon.composition.model.DeploymentContext;
  +import org.apache.avalon.composition.model.ComponentContext;
   import org.apache.avalon.composition.model.ModelRuntimeException;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  @@ -79,7 +79,7 @@
       // immutable state
       //==============================================================
   
  -    private final DeploymentContext m_context;
  +    private final ComponentContext m_context;
   
       //==============================================================
       // constructor
  @@ -90,7 +90,7 @@
       *
       * @param context the deployment context
       */
  -    public DefaultContext( DeploymentContext context )
  +    public DefaultContext( ComponentContext context )
       {
           m_context = context;
       }
  
  
  
  1.3.2.2   +30 -9     avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContextModel.java
  
  Index: DefaultContextModel.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContextModel.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- DefaultContextModel.java	3 Jan 2004 18:14:58 -0000	1.3.2.1
  +++ DefaultContextModel.java	4 Jan 2004 17:23:16 -0000	1.3.2.2
  @@ -57,7 +57,7 @@
   import org.apache.avalon.composition.model.ContextModel;
   import org.apache.avalon.composition.model.Model;
   import org.apache.avalon.composition.model.ModelException;
  -import org.apache.avalon.composition.model.DeploymentContext;
  +import org.apache.avalon.composition.model.ComponentContext;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.context.Context;
  @@ -101,7 +101,7 @@
   
       private final ContextDirective m_directive;
   
  -    private final DeploymentContext m_context;
  +    private final ComponentContext m_context;
   
       private final Class m_strategy;
   
  @@ -127,7 +127,7 @@
       */
       public DefaultContextModel( 
         Logger logger, ContextDescriptor descriptor, 
  -      ContextDirective directive, DeploymentContext context )
  +      ContextDirective directive, ComponentContext context )
         throws ModelException
       {
           super( logger );
  @@ -167,10 +167,31 @@
                   }
                   catch( ContextException e )
                   {
  -                    final String error = 
  -                      REZ.getString( 
  -                        "context.non-standard-avalon-key.error", key );
  -                    throw new ModelException( error );
  +                    if( entry.isRequired() )
  +                    {
  +                        final String error = 
  +                          REZ.getString( 
  +                            "context.non-standard-avalon-key.error", key );
  +                         throw new ModelException( error );
  +                    }
  +                }
  +            }
  +            else if( key.startsWith( "urn:merlin:" ) )
  +            {
  +                try
  +                {
  +                    Object value = m_context.getSystemContext().get( key );
  +                    m_map.put( key, value );
  +                }
  +                catch( ContextException e )
  +                {
  +                    if( entry.isRequired() )
  +                    {
  +                        final String error = 
  +                          REZ.getString( 
  +                            "context.non-standard-avalon-key.error", key );
  +                        throw new ModelException( error );
  +                    }
                   }
               }
               else
  @@ -361,7 +382,7 @@
       *   construct the context instance
       */
       private Context createComponentContext( 
  -      DeploymentContext context, ContextDescriptor descriptor, ContextDirective directive )
  +      ComponentContext context, ContextDescriptor descriptor, ContextDirective directive )
         throws ModelException
       {
           ClassLoader classLoader = context.getClassLoader();
  
  
  
  1.2.2.1   +4 -4      avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultImportModel.java
  
  Index: DefaultImportModel.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultImportModel.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- DefaultImportModel.java	28 Oct 2003 20:21:00 -0000	1.2
  +++ DefaultImportModel.java	4 Jan 2004 17:23:17 -0000	1.2.2.1
  @@ -53,7 +53,7 @@
   import java.util.Map;
   
   import org.apache.avalon.composition.model.ModelException;
  -import org.apache.avalon.composition.model.DeploymentContext;
  +import org.apache.avalon.composition.model.ComponentContext;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.context.ContextException;
  @@ -85,7 +85,7 @@
   
       private final EntryDescriptor m_descriptor;
   
  -    private final DeploymentContext m_context;
  +    private final ComponentContext m_context;
   
       private final Map m_map;
   
  @@ -108,7 +108,7 @@
       */
       public DefaultImportModel( 
         EntryDescriptor descriptor, ImportDirective directive, 
  -      DeploymentContext context, Map map )
  +      ComponentContext context, Map map )
       {
           super( descriptor );
           if( directive == null )
  
  
  
  1.3.2.3   +5 -5      avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultModelFactory.java
  
  Index: DefaultModelFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultModelFactory.java,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -r1.3.2.2 -r1.3.2.3
  --- DefaultModelFactory.java	3 Jan 2004 22:08:21 -0000	1.3.2.2
  +++ DefaultModelFactory.java	4 Jan 2004 17:23:17 -0000	1.3.2.3
  @@ -59,8 +59,8 @@
   import org.apache.avalon.composition.model.ClassLoaderContext;
   import org.apache.avalon.composition.model.ContainmentModel;
   import org.apache.avalon.composition.model.ContainmentContext;
  -import org.apache.avalon.composition.model.DeploymentContext;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentContext;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.ModelFactory;
   import org.apache.avalon.composition.model.ModelException;
   import org.apache.avalon.composition.model.SystemContext;
  @@ -278,9 +278,9 @@
       * @param context a potentially foreign deployment context
       * @return the deployment model
       */
  -    public DeploymentModel createDeploymentModel( DeploymentContext context )
  +    public ComponentModel createComponentModel( ComponentContext context )
         throws ModelException
       {
  -        return new DefaultDeploymentModel( context );
  +        return new DefaultComponentModel( context );
       }
   }
  
  
  
  1.2.2.2   +1 -0      avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/Resources.properties,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- Resources.properties	3 Jan 2004 18:14:58 -0000	1.2.2.1
  +++ Resources.properties	4 Jan 2004 17:23:17 -0000	1.2.2.2
  @@ -98,6 +98,7 @@
   context.strategy.custom=custom strategy: {0}
   context.strategy.avalon=avalon strategy
   context.non-standard-avalon-key.error=The component has requested a Avalon context entry that is not know within the family of standard Avalon context keys.  The offending key is: {0}.
  +context.unknown-system-key.error=The component has requested a system context entry that is not know within the family of standard Merlin context keys.  The offending key is: {0}.
   context.missing-directive.error=The component has requested a non-avalon context entry. The container cannot resolve this request because no entry directive can be found the matches the key: {0}.
   context.unsupported-directive.error=The component has requested a context entry under the key [{0}]. The container cannot resolve this request because the entry directive type [{1}] is not supported at this time.
   context.non-compliance-constructor.error="Custom context class [{0}] does not implement a constructor pattern <init>( org.apache.avalon.framework.Context ).
  
  
  
  No                   revision
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/Resources.properties,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- Resources.properties	3 Jan 2004 18:14:58 -0000	1.2.2.1
  +++ Resources.properties	4 Jan 2004 17:23:17 -0000	1.2.2.2
  @@ -98,6 +98,7 @@
   context.strategy.custom=custom strategy: {0}
   context.strategy.avalon=avalon strategy
   context.non-standard-avalon-key.error=The component has requested a Avalon context entry that is not know within the family of standard Avalon context keys.  The offending key is: {0}.
  +context.unknown-system-key.error=The component has requested a system context entry that is not know within the family of standard Merlin context keys.  The offending key is: {0}.
   context.missing-directive.error=The component has requested a non-avalon context entry. The container cannot resolve this request because no entry directive can be found the matches the key: {0}.
   context.unsupported-directive.error=The component has requested a context entry under the key [{0}]. The container cannot resolve this request because the entry directive type [{1}] is not supported at this time.
   context.non-compliance-constructor.error="Custom context class [{0}] does not implement a constructor pattern <init>( org.apache.avalon.framework.Context ).
  
  
  
  No                   revision
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/Resources.properties,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- Resources.properties	3 Jan 2004 18:14:58 -0000	1.2.2.1
  +++ Resources.properties	4 Jan 2004 17:23:17 -0000	1.2.2.2
  @@ -98,6 +98,7 @@
   context.strategy.custom=custom strategy: {0}
   context.strategy.avalon=avalon strategy
   context.non-standard-avalon-key.error=The component has requested a Avalon context entry that is not know within the family of standard Avalon context keys.  The offending key is: {0}.
  +context.unknown-system-key.error=The component has requested a system context entry that is not know within the family of standard Merlin context keys.  The offending key is: {0}.
   context.missing-directive.error=The component has requested a non-avalon context entry. The container cannot resolve this request because no entry directive can be found the matches the key: {0}.
   context.unsupported-directive.error=The component has requested a context entry under the key [{0}]. The container cannot resolve this request because the entry directive type [{1}] is not supported at this time.
   context.non-compliance-constructor.error="Custom context class [{0}] does not implement a constructor pattern <init>( org.apache.avalon.framework.Context ).
  
  
  
  1.1.2.1   +395 -0    avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/Attic/DefaultComponentContext.java
  
  
  
  
  1.1.2.1   +1042 -0   avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/Attic/DefaultComponentModel.java
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.3   +7 -14     avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/Attic/AssemblyTestCase.java
  
  Index: AssemblyTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/Attic/AssemblyTestCase.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- AssemblyTestCase.java	4 Jan 2004 01:19:28 -0000	1.1.2.2
  +++ AssemblyTestCase.java	4 Jan 2004 17:23:17 -0000	1.1.2.3
  @@ -3,9 +3,8 @@
   package org.apache.avalon.composition.model.test;
   
   import org.apache.avalon.composition.model.Model;
  -import org.apache.avalon.composition.model.Composite;
   import org.apache.avalon.composition.model.ContainmentModel;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.DependencyModel;
   import org.apache.avalon.composition.model.AbstractTestCase;
   import org.apache.avalon.util.exception.ExceptionHelper;
  @@ -51,19 +50,16 @@
           {
               printContainmentModel( lead, (ContainmentModel) model );
           }
  -        else if( model instanceof DeploymentModel ) 
  +        else if( model instanceof ComponentModel ) 
           {
  -            printDeploymentModel( lead, (DeploymentModel) model );
  +            printComponentModel( lead, (ComponentModel) model );
           }
       }
   
       private void printContainmentModel( String lead, ContainmentModel model )
       {
           System.out.println( lead + "model:" + model );
  -        if( model instanceof Composite )
  -        {
  -            printCompositeModel( "\t" + lead, (Composite) model );
  -        }
  +        printCompositeModel( "\t" + lead, model );
           Model[] models = model.getModels();
           if( models.length > 0 )
           {
  @@ -96,16 +92,13 @@
           }
       }
   
  -    private void printDeploymentModel( String lead, DeploymentModel model )
  +    private void printComponentModel( String lead, ComponentModel model )
       {
           System.out.println( lead + "model:" + model );
  -        if( model instanceof Composite )
  -        {
  -            printCompositeModel( lead, (Composite) model );
  -        }
  +        printCompositeModel( lead, model );
       }
   
  -    private void printCompositeModel( String lead, Composite model )
  +    private void printCompositeModel( String lead, Model model )
       {
           Model[] models = model.getProviderGraph();
           for( int i=0; i<models.length; i++ )
  
  
  
  1.2.2.1   +2 -2      avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/ContextTestCase.java
  
  Index: ContextTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/ContextTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ContextTestCase.java	28 Oct 2003 20:21:01 -0000	1.2
  +++ ContextTestCase.java	4 Jan 2004 17:23:17 -0000	1.2.2.1
  @@ -5,7 +5,7 @@
   import java.io.File;
   import java.util.Date;
   
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.ContextModel;
   import org.apache.avalon.composition.model.AbstractTestCase;
   import org.apache.avalon.framework.context.Context;
  @@ -34,7 +34,7 @@
       */
       public void testStandardContextModel() throws Exception
       {
  -        DeploymentModel model = (DeploymentModel) m_model.getModel( "test-a" );
  +        ComponentModel model = (ComponentModel) m_model.getModel( "test-a" );
           if( model == null )
           {
               fail( "null deployment model" );
  
  
  
  1.2.2.1   +4 -4      avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/DependencyTestCase.java
  
  Index: DependencyTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/DependencyTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- DependencyTestCase.java	28 Oct 2003 20:21:01 -0000	1.2
  +++ DependencyTestCase.java	4 Jan 2004 17:23:17 -0000	1.2.2.1
  @@ -3,7 +3,7 @@
   package org.apache.avalon.composition.model.test;
   
   import org.apache.avalon.composition.model.ContainmentModel;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.DependencyModel;
   import org.apache.avalon.composition.model.AbstractTestCase;
   
  @@ -27,11 +27,11 @@
       */
       public void testStandardDependencyModel() throws Exception
       {
  -        DeploymentModel a = (DeploymentModel) m_model.getModel( "test-a" );
  +        ComponentModel a = (ComponentModel) m_model.getModel( "test-a" );
   
           ContainmentModel fred = (ContainmentModel) m_model.getModel( "fred" );
  -        DeploymentModel b = (DeploymentModel) fred.getModel( "test-b" );
  -        DeploymentModel c = (DeploymentModel) fred.getModel( "test-c" );
  +        ComponentModel b = (ComponentModel) fred.getModel( "test-b" );
  +        ComponentModel c = (ComponentModel) fred.getModel( "test-c" );
   
           if( c == null )
           {
  
  
  
  1.2.2.1   +3 -3      avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/TargetsTestCase.java
  
  Index: TargetsTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/TargetsTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- TargetsTestCase.java	28 Oct 2003 20:21:01 -0000	1.2
  +++ TargetsTestCase.java	4 Jan 2004 17:23:17 -0000	1.2.2.1
  @@ -5,7 +5,7 @@
   import java.io.File;
   
   import org.apache.avalon.composition.model.Model;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.AbstractTestCase;
   import org.apache.avalon.composition.data.Targets;
   import org.apache.avalon.composition.data.TargetDirective;
  @@ -45,9 +45,9 @@
                   TargetDirective target = targets[i];
                   final String path = target.getPath();
                   Model model = m_model.getModel( path );
  -                if( model instanceof DeploymentModel )
  +                if( model instanceof ComponentModel )
                   {
  -                    DeploymentModel deployment = (DeploymentModel) model;
  +                    ComponentModel deployment = (ComponentModel) model;
                       deployment.setConfiguration( target.getConfiguration() );
                       getLogger().debug( "model: " + deployment );
                       getLogger().debug( 
  
  
  
  No                   revision
  No                   revision
  1.7.2.3   +45 -20    avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java
  
  Index: DefaultFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java,v
  retrieving revision 1.7.2.2
  retrieving revision 1.7.2.3
  diff -u -r1.7.2.2 -r1.7.2.3
  --- DefaultFactory.java	3 Jan 2004 22:08:22 -0000	1.7.2.2
  +++ DefaultFactory.java	4 Jan 2004 17:23:17 -0000	1.7.2.3
  @@ -60,6 +60,7 @@
   import java.util.Locale;
   
   import org.apache.avalon.activation.appliance.Block;
  +import org.apache.avalon.activation.appliance.BlockContext;
   import org.apache.avalon.activation.appliance.Composite;
   import org.apache.avalon.activation.appliance.impl.AbstractBlock;
   import org.apache.avalon.activation.appliance.impl.DefaultServiceContext;
  @@ -78,7 +79,7 @@
   import org.apache.avalon.composition.logging.impl.DefaultLoggingManager;
   import org.apache.avalon.composition.logging.impl.FileTargetProvider;
   import org.apache.avalon.composition.model.ContainmentContext;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.ContainmentModel;
   import org.apache.avalon.composition.model.ModelFactory;
   import org.apache.avalon.composition.model.SystemContext;
  @@ -379,7 +380,7 @@
   
           File anchor = criteria.getAnchorDirectory();
   
  -        SystemContext systemContext = 
  +        DefaultSystemContext applicationContext = 
             new DefaultSystemContext( 
               m_logging,
               anchor,
  @@ -390,17 +391,52 @@
               criteria.isDebugEnabled() );
   
           //
  -        // create the system model and block
  +        // create the application model
           //
   
  -        final Logger systemLogger = getLogger();
  +        getLogger().info( "building application model" );
  +        final Logger applicationLogger = m_logging.getLoggerForCategory("");
  +        ClassLoader api = applicationContext.getCommonClassLoader();
  +        ContainmentModel application = 
  +          new DefaultContainmentModel(
  +            createContainmentContext( 
  +              applicationContext, applicationLogger, api,
  +              getContainmentProfile( 
  +                kernelConfig.getChild( "container" ) ) ) );
   
  +        //
  +        // create the system model and add the application model
  +        // as an available system context entry
  +        //
  +
  +        getLogger().info( "facilities deployment" );
  +
  +        Configuration facilities = 
  +          kernelConfig.getChild( "system" );
  +
  +        DefaultSystemContext systemContext = 
  +          new DefaultSystemContext( 
  +            m_logging,
  +            anchor,
  +            criteria.getContextDirectory(),
  +            criteria.getTempDirectory(),
  +            repository,
  +            loggingDescriptor.getName(),
  +            criteria.isDebugEnabled() );
  +
  +        systemContext.put( "urn:merlin:dir", criteria.getWorkingDirectory() );
  +        systemContext.put( "urn:merlin:anchor", criteria.getAnchorDirectory() );
  +        systemContext.put( "urn:merlin:model", application );
  +
  +        systemContext.makeReadOnly();
  +
  +        ClassLoader spi = BlockContext.class.getClassLoader();
  +        final Logger systemLogger = getLogger();
           ContainmentModel system = 
             new DefaultContainmentModel(
               createContainmentContext( 
  -              systemContext, systemLogger, m_classloader,
  -              getContainmentProfile( 
  -                kernelConfig.getChild( "system" ) ) ) );
  +              systemContext, systemLogger, spi,
  +              getContainmentProfile( facilities ) ) );
   
           //
           // TODO: now that the system context is established we 
  @@ -453,22 +489,10 @@
           }
   
           //
  -        // create the application model
  -        //
  -
  -        final Logger applicationLogger = m_logging.getLoggerForCategory("");
  -        ClassLoader api = systemContext.getCommonClassLoader();
  -        ContainmentModel application = 
  -          new DefaultContainmentModel(
  -            createContainmentContext( 
  -              systemContext, applicationLogger, api,
  -              getContainmentProfile( 
  -                kernelConfig.getChild( "container" ) ) ) );
  -
  -        //
           // install any blocks declared within the kernel context
           //
   
  +        getLogger().info( "block installation" );
           getLogger().debug( "install phase" );
           URL[] urls = criteria.getDeploymentURLs();
           for( int i=0; i<urls.length; i++ )
  @@ -519,6 +543,7 @@
           //
           // instantiate the runtime root application block
           //
  +        getLogger().info( "deployment" );
   
           getLogger().debug( "activation phase" );
           try
  
  
  
  1.1.2.1   +2 -2      avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultKernel.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- DefaultKernel.java	8 Dec 2003 15:37:13 -0000	1.1
  +++ DefaultKernel.java	4 Jan 2004 17:23:17 -0000	1.1.2.1
  @@ -68,7 +68,7 @@
   import org.apache.avalon.composition.logging.LoggingManager;
   import org.apache.avalon.composition.model.ContainmentContext;
   import org.apache.avalon.composition.model.ContainmentModel;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.util.StringHelper;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.logger.Logger;
  
  
  
  No                   revision
  No                   revision
  1.1.1.1.2.1 +2 -2      avalon/merlin/platform/tutorials/lifecycle/activation/src/java/tutorial/DemonstratableProvider.java
  
  Index: DemonstratableProvider.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/platform/tutorials/lifecycle/activation/src/java/tutorial/DemonstratableProvider.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- DemonstratableProvider.java	24 Sep 2003 09:34:03 -0000	1.1.1.1
  +++ DemonstratableProvider.java	4 Jan 2004 17:23:17 -0000	1.1.1.1.2.1
  @@ -51,7 +51,7 @@
   package tutorial;
   
   import org.apache.avalon.activation.lifecycle.LifecycleCreateExtension;
  -import org.apache.avalon.composition.model.DeploymentModel;
  +import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.context.Context;
  @@ -81,7 +81,7 @@
        * @param object the object under deployment
        * @exception if a deployment error occurs
        */
  -     public void create( DeploymentModel model, StageDescriptor stage, Object object )
  +     public void create( ComponentModel model, StageDescriptor stage, Object object )
          throws Exception
        {
            getLogger().info( "invoking create on target: " + model );
  
  
  

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


Mime
View raw message