avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject cvs commit: avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl DefaultContainmentModel.java DefaultSystemContext.java
Date Sun, 04 Jan 2004 12:05:21 GMT
niclas      2004/01/04 04:05:21

  Modified:    merlin/composition/api/src/java/org/apache/avalon/composition/model
                        ContainmentModel.java SystemContext.java
               merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        DefaultContainmentModel.java
                        DefaultSystemContext.java
  Log:
  Changes to support generic Parameters for the kernel, via kernel.xml. One such parameter
'DeploymentTimeout' exposed in the ContainmentModel for the new deployment handling.
  
  Revision  Changes    Path
  1.10      +8 -1      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
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ContainmentModel.java	29 Dec 2003 14:31:21 -0000	1.9
  +++ ContainmentModel.java	4 Jan 2004 12:05:21 -0000	1.10
  @@ -97,6 +97,13 @@
       * @return the classloader model
       */
       ClassLoaderModel getClassLoaderModel();
  +    
  +   /** Returns the timel imit of how long the deployment may take.
  +    *
  +    * @return the maximum time expressed in millisecond of how 
  +    * long a deployment may take.
  +    **/
  +   long getDeploymentTimeout();
   
      /**
       * Return the set of models nested within this model.
  
  
  
  1.2       +10 -1     avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/SystemContext.java
  
  Index: SystemContext.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/SystemContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SystemContext.java	24 Sep 2003 09:31:22 -0000	1.1
  +++ SystemContext.java	4 Jan 2004 12:05:21 -0000	1.2
  @@ -54,9 +54,12 @@
   
   import org.apache.avalon.composition.logging.LoggingManager;
   import org.apache.avalon.composition.model.ModelFactory;
  +
   import org.apache.avalon.repository.Repository;
  +
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.avalon.framework.parameters.Parameters;
   
   
   /**
  @@ -141,4 +144,10 @@
       */
       Logger getLogger();
   
  +    /** Returns the configurable kernel parameters.
  +     *
  +     * @return a Parameters object populated with the system
  +     * parameters.
  +     **/
  +    Parameters getSystemParameters();
   }
  
  
  
  1.14      +22 -1     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
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultContainmentModel.java	1 Jan 2004 13:08:56 -0000	1.13
  +++ DefaultContainmentModel.java	4 Jan 2004 12:05:21 -0000	1.14
  @@ -75,8 +75,10 @@
   import org.apache.avalon.composition.data.builder.XMLTargetsCreator;
   import org.apache.avalon.composition.data.builder.ContainmentProfileBuilder;
   import org.apache.avalon.composition.data.builder.XMLContainmentProfileCreator;
  +
   import org.apache.avalon.composition.event.CompositionEvent;
   import org.apache.avalon.composition.event.CompositionEventListener;
  +
   import org.apache.avalon.composition.model.ClassLoaderContext;
   import org.apache.avalon.composition.model.ClassLoaderModel;
   import org.apache.avalon.composition.model.ContainmentModel;
  @@ -87,17 +89,24 @@
   import org.apache.avalon.composition.model.ModelRuntimeException;
   import org.apache.avalon.composition.model.ModelSelector;
   import org.apache.avalon.composition.model.ProfileSelector;
  +import org.apache.avalon.composition.model.SystemContext;
   import org.apache.avalon.composition.model.TypeRepository;
  +
   import org.apache.avalon.composition.logging.LoggingManager;
   import org.apache.avalon.composition.util.StringHelper;
  +
   import org.apache.avalon.repository.Repository;
   import org.apache.avalon.repository.Artifact;
   import org.apache.avalon.repository.RepositoryException;
  +
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  +import org.apache.avalon.framework.parameters.Parameters;
  +
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  +
   import org.apache.avalon.meta.info.DependencyDescriptor;
   import org.apache.avalon.meta.info.ServiceDescriptor;
   import org.apache.avalon.meta.info.StageDescriptor;
  @@ -209,6 +218,18 @@
           return m_context.getClassLoaderModel();
       }
   
  +    /** Returns the time limit of how long the deployment may take.
  +     *
  +     * @return the maximum time expressed in millisecond of how 
  +     * long a deployment may take.
  +     **/
  +    public long getDeploymentTimeout()
  +    {
  +        SystemContext sc = m_context.getSystemContext();
  +        Parameters params = sc.getSystemParameters();
  +        return params.getParameterAsLong( "deployment-timeout", 1000 );
  +    }
  +   
      /**
       * Return the set of services produced by the model.
       * @return the services
  
  
  
  1.5       +19 -3     avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java
  
  Index: DefaultSystemContext.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultSystemContext.java	7 Dec 2003 08:36:07 -0000	1.4
  +++ DefaultSystemContext.java	4 Jan 2004 12:05:21 -0000	1.5
  @@ -68,6 +68,7 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.context.DefaultContext;
  +import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.composition.data.CategoryDirective;
   
   
  @@ -107,7 +108,7 @@
           final File temp = new File( working, "temp" );
   
           return new DefaultSystemContext( 
  -          logging, base, home, temp, repository, "system", false );
  +          logging, base, home, temp, repository, "system", false, null );
       }
   
       private static Repository createRepository( File root ) throws Exception
  @@ -187,6 +188,8 @@
       private final Logger m_logger;
   
       private ModelFactory m_factory;
  +    
  +    private Parameters m_Parameters;
   
       //==============================================================
       // mutable state
  @@ -212,7 +215,8 @@
       */
       public DefaultSystemContext( 
         LoggingManager logging, File base, File home, File temp, 
  -      Repository repository, String category, boolean trace )
  +      Repository repository, String category, boolean trace, 
  +      Parameters params )
       {
           if( base == null )
           {
  @@ -226,6 +230,12 @@
           {
               throw new NullPointerException( "logger" );
           }
  +        if( params == null )
  +        {
  +            params = new Parameters();
  +            params.makeReadOnly();
  +        }
  +           
           if( !base.isDirectory() )
           {
               final String error = 
  @@ -245,6 +255,7 @@
           m_common = Logger.class.getClassLoader();
   
           m_factory = new DefaultModelFactory( this );
  +        m_Parameters = params;
       }
   
       //==============================================================
  @@ -365,5 +376,10 @@
       public Logger getLogger()
       {
           return m_logger;
  +    }
  +    
  +    public Parameters getSystemParameters()
  +    {
  +        return m_Parameters;
       }
   }
  
  
  

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


Mime
View raw message