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/08 15:45:11 UTC

cvs commit: avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model ContainmentContext.java ContextModel.java DeploymentContext.java ModelFactory.java ContainmentModel.java DeploymentModel.java SystemContext.java ContainmentModelFactory.java

mcconnell    2003/07/08 06:45:11

  Modified:    merlin/composition-spi/src/java/org/apache/avalon/composition/model
                        ContainmentModel.java DeploymentModel.java
                        SystemContext.java
  Added:       merlin/composition-spi/src/java/org/apache/avalon/composition/model
                        ContainmentContext.java ContextModel.java
                        DeploymentContext.java ModelFactory.java
  Removed:     merlin/composition-spi/src/java/org/apache/avalon/composition/model
                        ContainmentModelFactory.java
  Log:
  Introducing ContainmentContext and DeploymentContext.
  
  Revision  Changes    Path
  1.7       +1 -7      avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/ContainmentModel.java
  
  Index: ContainmentModel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/ContainmentModel.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ContainmentModel.java	7 Jul 2003 18:45:35 -0000	1.6
  +++ ContainmentModel.java	8 Jul 2003 13:45:10 -0000	1.7
  @@ -75,12 +75,6 @@
       String getPartition();
   
      /**
  -    * Return the containment context object.
  -    * @return the system context
  -    */
  -    SystemContext getContext();
  -
  -   /**
       * Return the classloader model assigned to this 
       * containment model.
       *
  
  
  
  1.5       +5 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeploymentModel.java	7 Jul 2003 18:45:35 -0000	1.4
  +++ DeploymentModel.java	8 Jul 2003 13:45:10 -0000	1.5
  @@ -157,10 +157,11 @@
       boolean isContextDependent();
   
      /**
  -    * Return the context map established for the component.
  +    * Return the context model for this deployment model.
       * 
  -    * @return the context map
  +    * @return the context model if this model is context dependent, else
  +    *   the return value is null
       */
  -    Map getContextMap();
  +    ContextModel getContextModel();
   
   }
  
  
  
  1.3       +29 -6     avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/SystemContext.java
  
  Index: SystemContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/SystemContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SystemContext.java	7 Jul 2003 18:45:35 -0000	1.2
  +++ SystemContext.java	8 Jul 2003 13:45:10 -0000	1.3
  @@ -53,6 +53,8 @@
   import java.io.File;
   
   import org.apache.avalon.composition.repository.Repository;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.logger.Logger;
   
   
   /**
  @@ -61,7 +63,7 @@
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public interface SystemContext
  +public interface SystemContext extends Context
   {
      /**
       * Return the base directory from which relative references 
  @@ -72,7 +74,7 @@
       File getBaseDirectory();
   
      /**
  -    * Return the working directory from containers may establish
  +    * Return the home directory from which containers may establish
       * persistent content.
       *
       * @return the working directory
  @@ -80,10 +82,10 @@
       File getHomeDirectory();
   
      /**
  -    * Return the temporary directory from which a container 
  -    * may use to establish transient content. 
  +    * Return the temp directory from which containers may establish
  +    * non-persistent content.
       *
  -    * @return the temporary directory
  +    * @return the temp directory
       */
       File getTempDirectory();
   
  @@ -94,5 +96,26 @@
       * @return the repository
       */
       Repository getRepository();
  +
  +   /**
  +    * Return the system trace flag.
  +    *
  +    * @return the trace flag
  +    */
  +    boolean isTraceEnabled();
  +
  +   /**
  +    * Return the system classloader.
  +    *
  +    * @return the system classloader
  +    */
  +    ClassLoader getSystemClassLoader();
  +
  +   /**
  +    * Return the system logging channel.
  +    *
  +    * @return the system logging channel
  +    */
  +    Logger getLogger();
   
   }
  
  
  
  1.1                  avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/ContainmentContext.java
  
  Index: ContainmentContext.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.avalon.composition.model;
  
  import java.io.File;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.Logger;
  
  /**
   * Defintion of a working context.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/07/08 13:45:10 $
   */
  public interface ContainmentContext extends Context
  {
     /**
      * Return the system context.
      *
      * @return the system context
      */
      SystemContext getSystemContext();
  
     /**
      * Return the working directory for a container.
      *
      * @return the working directory
      */
      File getHomeDirectory();
  
     /**
      * Return the temporary directory for a container. 
      *
      * @return the temporary directory
      */
      File getTempDirectory();
  
     /**
      * Return the containment classloader.
      *
      * @return the classloader
      */
      ClassLoader getClassLoader();
  
     /**
      * Return the logging channel.
      *
      * @return the logging channel
      */
      Logger getLogger();
  
  }
  
  
  
  1.1                  avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/ContextModel.java
  
  Index: ContextModel.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.avalon.composition.model;
  
  import java.util.Map;
  
  
  /**
   * <p>Specification of a context model from which a 
   * a fully qualifed context can be established.</p>
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/07/08 13:45:10 $
   */
  public interface ContextModel
  {
     /**
      * Return the class representing the contextualization 
      * stage interface.  
      * 
      * @return the contextualization interface class
      */
      Class getStrategyClass();
  
  
     /**
      * Return the class representing the context implementation.
      * 
      * @return the context implementation class
      */
      Class getContextClass();
  
     /**
      * Return the context map established for the component.
      * 
      * @return the context map
      */
      Map getContextMap();
  
  }
  
  
  
  1.1                  avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/DeploymentContext.java
  
  Index: DeploymentContext.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.avalon.composition.model;
  
  import java.io.File;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.meta.info.Type;
  import org.apache.avalon.meta.data.DeploymentProfile;
  
  /**
   * Defintion of a deployment context.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/07/08 13:45:10 $
   */
  public interface DeploymentContext extends Context
  {
     /**
      * Return the partition name that the component will execute within.
      *
      * @return the partition name
      */
      String getPartitionName();
  
     /**
      * Return the system context.
      *
      * @return the system context
      */
      ContainmentContext getContainmentContext();
  
     /**
      * Return the working directory for the component.
      *
      * @return the working directory
      */
      File getHomeDirectory();
  
     /**
      * Return the temporary directory for the component.
      *
      * @return the temporary directory
      */
      File getTempDirectory();
  
     /**
      * Return the logging channel assignable to the deployment model.
      *
      * @return the logging channel
      */
      Logger getLogger();
  
     /**
      * Return the deployment profile.
      *
      * @return the profile
      */
      DeploymentProfile getProfile();
  
     /**
      * Return the component type.
      *
      * @return the type defintion
      */
      Type getType();
  
     /**
      * Return the component class.
      *
      * @return the class
      */
      Class getDeploymentClass();
  
     /**
      * Return the classloader for the component.
      *
      * @return the classloader
      */
      ClassLoader getClassLoader();
  
  }
  
  
  
  1.1                  avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/ModelFactory.java
  
  Index: ModelFactory.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.avalon.composition.model;
  
  import java.io.File;
  
  import org.apache.avalon.composition.repository.Repository;
  import org.apache.avalon.meta.data.ContainmentProfile;
  
  /**
   * A factory enabling the establishment of new containment model instances.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/07/08 13:45:10 $
   */
  public interface ModelFactory 
  {
     /**
      * Creation of a new root containment model.
      *
      * @param profile a containment profile 
      * @return the containment model
      * @exception ModelException if an error occurs during model establishment
      */
      ContainmentModel createContainmentModel( ContainmentProfile profile ) 
        throws ModelException;
  
     /**
      * Creation of a new nested containment model.
      *
      * @param parent the containment model into which the new 
      *   containment model is to be added
      * @param profile the containment profile
      * @return the containment model
      * @exception ModelException if an error occurs during model establishment
      */
      public ContainmentModel createContainmentModel( 
        final ContainmentModel parent, ContainmentProfile profile )
        throws ModelException;
  }
  
  
  

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