You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/07/25 00:12:42 UTC

cvs commit: avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model DependencyModel.java DeploymentModel.java

mcconnell    2003/07/24 15:12:42

  Modified:    merlin/composition-spi/src/java/org/apache/avalon/composition/data
                        DeploymentProfile.java
               merlin/composition-spi/src/java/org/apache/avalon/composition/model
                        DependencyModel.java DeploymentModel.java
  Log:
  Enhancement of the deployment profile to include stage directives.
  
  Revision  Changes    Path
  1.3       +52 -4     avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/data/DeploymentProfile.java
  
  Index: DeploymentProfile.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/data/DeploymentProfile.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeploymentProfile.java	24 Jul 2003 13:14:55 -0000	1.2
  +++ DeploymentProfile.java	24 Jul 2003 22:12:41 -0000	1.3
  @@ -170,6 +170,11 @@
       private DependencyDirective[] m_dependencies;
   
       /**
  +     * The stage directives.
  +     */
  +    private StageDirective[] m_stages;
  +
  +    /**
        * The creation mode.
        */
       private Mode m_mode;
  @@ -182,7 +187,9 @@
              final String name, 
              final String classname )
       {
  -        this( name, false, classname, null, null, null, null, null, Mode.IMPLICIT );
  +        this( 
  +          name, false, classname, null, null, null, null, 
  +          null, null, Mode.IMPLICIT );
       }
   
       public DeploymentProfile( 
  @@ -192,6 +199,7 @@
              final CategoriesDirective categories, 
              final ContextDirective context, 
              final DependencyDirective[] dependencies,
  +           final StageDirective[] stages,
              final Parameters parameters, 
              final Configuration config,
              final Mode mode )
  @@ -201,6 +209,9 @@
           m_classname = classname;
           m_categories = categories;
           m_context = context;
  +        m_parameters = parameters;
  +        m_configuration = config;
  +
           if( dependencies == null )
           {
               m_dependencies = new DependencyDirective[0];
  @@ -209,8 +220,15 @@
           {
               m_dependencies = dependencies;
           }
  -        m_parameters = parameters;
  -        m_configuration = config;
  +
  +        if( stages == null )
  +        {
  +            m_stages = new StageDirective[0];
  +        }
  +        else
  +        {
  +            m_stages = stages;
  +        }
       }
   
       //--------------------------------------------------------------------------
  @@ -269,6 +287,36 @@
           for( int i=0; i<directives.length; i++ )
           {
               DependencyDirective directive = directives[i];
  +            if( directive.getKey().equals( key ) )
  +            {
  +                return directive;
  +            }
  +        }
  +        return null;
  +    }
  +
  +    /**
  +     * Return the stage directives.
  +     *
  +     * @return the set of StageDirective statements for the profile.
  +     */
  +    public StageDirective[] getStageDirectives()
  +    {
  +        return m_stages;
  +    }
  +
  +    /**
  +     * Return the dependency directive for a supplied key.
  +     *
  +     * @return the matching DependencyDirective (possibly null if 
  +     *   no directive is declared for the given key)
  +     */
  +    public StageDirective getStageDirective( final String key )
  +    {
  +        StageDirective[] directives = getStageDirectives();
  +        for( int i=0; i<directives.length; i++ )
  +        {
  +            StageDirective directive = directives[i];
               if( directive.getKey().equals( key ) )
               {
                   return directive;
  
  
  
  1.4       +4 -6      avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/DependencyModel.java
  
  Index: DependencyModel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/DependencyModel.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DependencyModel.java	24 Jul 2003 13:14:55 -0000	1.3
  +++ DependencyModel.java	24 Jul 2003 22:12:41 -0000	1.4
  @@ -55,8 +55,7 @@
   
   /**
    * Dependency model handles the establishment of an explicit source 
  - * provider defintion and functionality dealing with service provider 
  - * selection based on service qualification.
  + * provider defintion or service provider selection rules.
    *
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
  @@ -64,7 +63,7 @@
   public interface DependencyModel
   {
      /**
  -    * Return the dependencies for the model.
  +    * Return the dependency descriptor for the model.
       *
       * @return the descriptors declaring the component 
       *    dependency
  @@ -76,7 +75,7 @@
       * If a dependency directive has been declared
       * and the directive contains a source declaration, the value 
       * returned is the result of parsing the source value relative 
  -    * to the absolute address of the implementing component.
  +    * to the absolute address of the dependent component.
       *
       * @return the explicit path
       */
  @@ -87,7 +86,6 @@
       * set of acceptable service as a ordered sequence.
       *
       * @param candidates the set of candidate services for the dependency
  -    *    matching the supplied key
       * @return the accepted candidates in ranked order
       */
       ServiceDescriptor[] filter( ServiceDescriptor[] candidates );
  
  
  
  1.10      +8 -1      avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/DeploymentModel.java
  
  Index: DeploymentModel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/DeploymentModel.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DeploymentModel.java	24 Jul 2003 13:14:55 -0000	1.9
  +++ DeploymentModel.java	24 Jul 2003 22:12:41 -0000	1.10
  @@ -188,4 +188,11 @@
       */
       DependencyModel[] getDependencyModels();
   
  +   /**
  +    * Return the stage models for this deployment model.
  +    *
  +    * @return the stage models
  +    */
  +    StageModel[] getStageModels();
  +
   }
  
  
  

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