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 2004/02/07 21:23:32 UTC

cvs commit: avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl DefaultFactory.java DefaultKernel.java DefaultKernelContext.java

mcconnell    2004/02/07 12:23:32

  Modified:    merlin   INSTALL.TXT
               merlin/composition/api/src/java/org/apache/avalon/composition/model
                        ContainmentModel.java
               merlin/facilities/http/util/src/java/org/apache/avalon/http/util
                        HttpHandler.java
               merlin/kernel/api/src/java/org/apache/avalon/merlin
                        KernelContext.java
               merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl
                        DefaultFactory.java DefaultKernel.java
                        DefaultKernelContext.java
  Log:
  Remove notion of seperated facilities and instead treat facilities simply as privaliged components declared under block space. Privalige is determined relative to context entry requests.
  
  Revision  Changes    Path
  1.12      +99 -99    avalon/merlin/INSTALL.TXT
  
  Index: INSTALL.TXT
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/INSTALL.TXT,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- INSTALL.TXT	7 Feb 2004 06:06:30 -0000	1.11
  +++ INSTALL.TXT	7 Feb 2004 20:23:32 -0000	1.12
  @@ -1,99 +1,99 @@
  -
  -PROJECT: Merlin @VERSION@
  -====================================================================
  -
  -DESCRIPTION: 
  -------------
  -
  -This directory contains the merlin system installation and related 
  -resources.
  -
  -  /merlin
  -    /bin
  -    /config
  -    /system
  -    README.TXT
  -    LICENSE.TXT
  -    INSTALL.TXT
  -  /plugins
  -    @META_PLUGIN_JAR@
  -    @MERLIN_PLUGIN_JAR@
  -
  -
  -Installing Merlin.
  -------------------
  -
  -To use Merlin command line support or the Merlin NT Service
  -you will need to define the MERLIN_HOME environment
  -variable for your system and include MERLIN_HOME/bin in
  -your system path.  The MERLIN_HOME environment variable
  -should point to the merlin directory.
  -
  -Under Windows you can set environment variables by selecting the 
  -Environment Tab from the System Control Panel.
  -
  -Under Lunix you can do this as follows:
  -
  -  $ echo '
  -  > # set location of merlin
  -  > export MERLIN_HOME=/opt/merlin
  -  > # include it in the path
  -  > export PATH=$PATH:$MERLIN_HOME/bin
  -  > ' >> ~/.bash_profile
  -  $ source ~/.bash_profile
  -
  -Versions of Merlin prior to the 3.2-dev 20031210 build maintained 
  -a local repository of jar files under the %MERLIN_HOME%/repository
  -directory.  As of the 20031210 build the repository is maintained 
  -under AVALON_HOME which defaults to ${user.home}/.avalon.  To 
  -override this behaviour you can either define a AVALON_HOME 
  -environment variable or you can add a merlin.properties file to 
  -${user.home} containing the "merlin.repository" property key and 
  -a value point to you preferred repository location.
  -
  -To confirm that your environment variables are correct, you
  -should open a new command window and invoke the Merlin
  -CLI application.
  -
  -Under DOS:
  -
  -  $ merlin -version
  -
  -Under Lunix:
  -
  -  $ merlin.sh -version
  -
  -The installation of Merlin is now complete, however, two plugins are
  -provided with the installation supporting merlin development under the 
  -Maven platform.  These plugins should be placed in the Maven plugin 
  -directory (${maven.home.local}\plugins).
  -
  -  [YOUR-MAVEN-HOME]\plugins\@META_PLUGIN_JAR@
  -  [YOUR-MAVEN-HOME]\plugins\@MERLIN_PLUGIN_JAR@
  -
  -Please note that if you are upgrading an existing installation you must
  -delete the following two directories:
  -
  -  [YOUR-MAVEN-HOME]\plugins\avalon-meta-plugin-*
  -  [YOUR-MAVEN-HOME]\plugins\merlin-plugin-* 
  -
  -Replace the existing avalon-meta and merlin plugin jar files with the supplied
  -versions.  Finally, delete all *.cache files in the Maven plugin directory.
  -
  -You now have everything in place to start using the Merlin Tutorial or 
  -building you own components.  If you have any problems, please subscribe
  -and post a message to users@avalon.apache.org.
  -
  -Special Note for JRE 1.3 and earlier.
  --------------------------------------
  -
  -Some applications assume that XML parsing classes are available withing
  -the JRE.  This is not the case with JDK 1.3 and earlier.  To resolve this
  -you can copy the following files to the JAVAHOME/lib/ext directory or 
  -declare an alternative directory as a JVM argument under the 
  -MERLIN_JVM_OPTS environment variable, i.e. -Djava.ext.dir=someDirectory
  -
  -  system/xml-apis/jars/xml-apis-2.0.2.jar
  -  system/xml-apis/jars/xmlParserAPIs-2.0.2.jar
  -  system/xerces/jars/xerces-2.4.0.jar
  -
  +
  +PROJECT: Merlin @VERSION@
  +====================================================================
  +
  +DESCRIPTION: 
  +------------
  +
  +This directory contains the merlin system installation and related 
  +resources.
  +
  +  /merlin
  +    /bin
  +    /config
  +    /system
  +    README.TXT
  +    LICENSE.TXT
  +    INSTALL.TXT
  +  /plugins
  +    @META_PLUGIN_JAR@
  +    @MERLIN_PLUGIN_JAR@
  +
  +
  +Installing Merlin.
  +------------------
  +
  +To use Merlin command line support or the Merlin NT Service
  +you will need to define the MERLIN_HOME environment
  +variable for your system and include MERLIN_HOME/bin in
  +your system path.  The MERLIN_HOME environment variable
  +should point to the merlin directory.
  +
  +Under Windows you can set environment variables by selecting the 
  +Environment Tab from the System Control Panel.
  +
  +Under Lunix you can do this as follows:
  +
  +  $ echo '
  +  > # set location of merlin
  +  > export MERLIN_HOME=/opt/merlin
  +  > # include it in the path
  +  > export PATH=$PATH:$MERLIN_HOME/bin
  +  > ' >> ~/.bash_profile
  +  $ source ~/.bash_profile
  +
  +Versions of Merlin prior to the 3.2-dev 20031210 build maintained 
  +a local repository of jar files under the %MERLIN_HOME%/repository
  +directory.  As of the 20031210 build the repository is maintained 
  +under AVALON_HOME which defaults to ${user.home}/.avalon.  To 
  +override this behaviour you can either define a AVALON_HOME 
  +environment variable or you can add a merlin.properties file to 
  +${user.home} containing the "merlin.repository" property key and 
  +a value point to you preferred repository location.
  +
  +To confirm that your environment variables are correct, you
  +should open a new command window and invoke the Merlin
  +CLI application.
  +
  +Under DOS:
  +
  +  $ merlin -version
  +
  +Under Lunix:
  +
  +  $ merlin.sh -version
  +
  +The installation of Merlin is now complete, however, two plugins are
  +provided with the installation supporting merlin development under the 
  +Maven platform.  These plugins should be placed in the Maven plugin 
  +directory (${maven.home.local}\plugins).
  +
  +  [YOUR-MAVEN-HOME]\plugins\@META_PLUGIN_JAR@
  +  [YOUR-MAVEN-HOME]\plugins\@MERLIN_PLUGIN_JAR@
  +
  +Please note that if you are upgrading an existing installation you must
  +delete the following two directories:
  +
  +  [YOUR-MAVEN-HOME]\plugins\avalon-meta-plugin-*
  +  [YOUR-MAVEN-HOME]\plugins\merlin-plugin-* 
  +
  +Replace the existing avalon-meta and merlin plugin jar files with the supplied
  +versions.  Finally, delete all *.cache files in the Maven plugin directory.
  +
  +You now have everything in place to start using the Merlin Tutorial or 
  +building you own components.  If you have any problems, please subscribe
  +and post a message to users@avalon.apache.org.
  +
  +Special Note for JRE 1.3 and earlier.
  +-------------------------------------
  +
  +Some applications assume that XML parsing classes are available withing
  +the JRE.  This is not the case with JDK 1.3 and earlier.  To resolve this
  +you can copy the following files to the JAVAHOME/lib/ext directory or 
  +declare an alternative directory as a JVM argument under the 
  +MERLIN_JVM_OPTS environment variable, i.e. -Djava.ext.dir=someDirectory
  +
  +  system/xml-apis/jars/xml-apis-2.0.2.jar
  +  system/xml-apis/jars/xmlParserAPIs-2.0.2.jar
  +  system/xerces/jars/xerces-2.4.0.jar
  +
  
  
  
  1.17      +4 -4      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ContainmentModel.java	7 Feb 2004 17:41:28 -0000	1.16
  +++ ContainmentModel.java	7 Feb 2004 20:23:32 -0000	1.17
  @@ -114,14 +114,14 @@
       DeploymentModel getModel( String path );
   
      /**
  -    * Addition of a new subsidiary model within
  -    * the containment context using a supplied profile url.
  +    * Addition of a new subsidiary containment model
  +    * using a supplied profile url.
       *
       * @param url a containment profile url
       * @return the model based on the derived profile
       * @exception ModelException if an error occurs during model establishment
       */
  -    DeploymentModel addModel( URL url ) throws ModelException;
  +    ContainmentModel addContainmentModel( URL url ) throws ModelException;
   
      /**
       * Addition of a new subsidiary containment model within
  
  
  
  1.3       +1 -1      avalon/merlin/facilities/http/util/src/java/org/apache/avalon/http/util/HttpHandler.java
  
  Index: HttpHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/facilities/http/util/src/java/org/apache/avalon/http/util/HttpHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HttpHandler.java	7 Feb 2004 14:03:42 -0000	1.2
  +++ HttpHandler.java	7 Feb 2004 20:23:32 -0000	1.3
  @@ -181,7 +181,7 @@
        * This makes browser and proxy caches work more effectively,
        * reducing the load on server and network resources.
        *
  -     * @param requset the <code>HttpServletRequest</code> 
  +     * @param request the <code>HttpServletRequest</code> 
        *   object that is sent to the component
        *
        * @return a <code>long</code> integer specifying
  
  
  
  1.3       +1 -7      avalon/merlin/kernel/api/src/java/org/apache/avalon/merlin/KernelContext.java
  
  Index: KernelContext.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/api/src/java/org/apache/avalon/merlin/KernelContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- KernelContext.java	24 Jan 2004 23:25:31 -0000	1.2
  +++ KernelContext.java	7 Feb 2004 20:23:32 -0000	1.3
  @@ -38,12 +38,6 @@
       Logger getLogger();
   
      /**
  -    * Return the facilities model.
  -    * @return the internal container facilities
  -    */
  -    ContainmentModel getFacilitiesModel();
  -
  -   /**
       * Return the application model.
       * @return the root application model 
       */
  
  
  
  1.24      +37 -32    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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DefaultFactory.java	6 Feb 2004 15:27:15 -0000	1.23
  +++ DefaultFactory.java	7 Feb 2004 20:23:32 -0000	1.24
  @@ -258,21 +258,21 @@
           // changes.
           // 
   
  -        getLogger().info( "facilities deployment" );
  -        Configuration facilitiesConfig = 
  -          config.getChild( "facilities" );
  -        Logger facilitiesLogger = getLogger();
  -
  -        DelegatingSystemContext system = 
  -          new DelegatingSystemContext( systemContext );
  -        system.put( "urn:composition:dir", criteria.getWorkingDirectory() );
  -        system.put( "urn:composition:anchor", criteria.getAnchorDirectory() );
  -        system.put( "urn:composition:application", application );
  -        system.makeReadOnly();
  -
  -        ContainmentModel facilities = 
  -          createFacilitiesModel( 
  -            system, facilitiesLogger, facilitiesConfig );
  +        //getLogger().info( "facilities deployment" );
  +        //Configuration facilitiesConfig = 
  +        //  config.getChild( "facilities" );
  +        //Logger facilitiesLogger = getLogger();
  +
  +        //DelegatingSystemContext system = 
  +        //  new DelegatingSystemContext( systemContext );
  +        //system.put( "urn:composition:dir", criteria.getWorkingDirectory() );
  +        //system.put( "urn:composition:anchor", criteria.getAnchorDirectory() );
  +        //system.put( "urn:composition:application", application );
  +        //system.makeReadOnly();
  +
  +        //ContainmentModel facilities = 
  +        //  createFacilitiesModel( 
  +        //    system, facilitiesLogger, facilitiesConfig );
   
           //
           // Assembly of the system containment model. Note .. its not sure
  @@ -285,7 +285,7 @@
           //
   
           KernelContext kernelContext = 
  -          new DefaultKernelContext( getLogger(), facilities, application );
  +          new DefaultKernelContext( getLogger(), application );
           Kernel kernel = new DefaultKernel( kernelContext );
           setShutdownHook( getLogger(), kernel );
   
  @@ -309,7 +309,7 @@
   
               try
               {
  -                application.addModel( url );
  +                application.addContainmentModel( url );
               }
               catch( Throwable e )
               {
  @@ -472,16 +472,16 @@
           return new DefaultContainmentModel( context );
       }
   
  -    private ContainmentModel createFacilitiesModel(
  -      SystemContext system, Logger logger, Configuration config )
  -      throws Exception
  -    {   
  -        ClassLoader spi = Block.class.getClassLoader();
  -        ContainmentProfile profile = getContainmentProfile( config );
  -        return new DefaultContainmentModel(
  -            createContainmentContext( 
  -              system, logger, spi, profile ) );
  -    }
  +    //private ContainmentModel createFacilitiesModel(
  +    //  SystemContext system, Logger logger, Configuration config )
  +    //  throws Exception
  +    //{   
  +    //    ClassLoader spi = Block.class.getClassLoader();
  +    //    ContainmentProfile profile = getContainmentProfile( config );
  +    //    return new DefaultContainmentModel(
  +    //        createContainmentContext( 
  +    //          system, logger, spi, profile ) );
  +    //}
   
      /**
       * Creation of a new root containment context.
  @@ -700,7 +700,8 @@
           }
       }
   
  -    private Configuration getLoggingConfiguration( KernelCriteria criteria, Configuration config )
  +    private Configuration getLoggingConfiguration( 
  +      KernelCriteria criteria, Configuration config )
         throws Exception
       {
           if( null != config.getChild( "logging", false ) )
  @@ -837,7 +838,8 @@
       }
   
       private void createInfoListing( 
  -      StringBuffer buffer, String[] hosts, InitialContext context, KernelCriteria criteria )
  +      StringBuffer buffer, String[] hosts, InitialContext context, 
  +      KernelCriteria criteria )
       {
           buffer.append( "\n" );
           buffer.append( 
  @@ -1019,7 +1021,8 @@
           }
       }
   
  -    public void printContainmentModel( StringBuffer buffer, String lead, ContainmentModel model )
  +    public void printContainmentModel( 
  +      StringBuffer buffer, String lead, ContainmentModel model )
       {
           buffer.append( 
             "\n" + lead 
  @@ -1059,7 +1062,8 @@
           }
       }
   
  -    public void printComponentModel( StringBuffer buffer, String lead, ComponentModel model )
  +    public void printComponentModel( 
  +      StringBuffer buffer, String lead, ComponentModel model )
       {
           buffer.append( 
             "\n" + lead 
  @@ -1070,7 +1074,8 @@
           printDeploymentModel( buffer, lead, model );
       }
   
  -    public void printDeploymentModel( StringBuffer buffer, String lead, DeploymentModel model )
  +    public void printDeploymentModel( 
  +      StringBuffer buffer, String lead, DeploymentModel model )
       {
           DeploymentModel[] providers = model.getProviderGraph();
           DeploymentModel[] consumers = model.getConsumerGraph();
  
  
  
  1.8       +1 -35     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultKernel.java	6 Feb 2004 15:27:15 -0000	1.7
  +++ DefaultKernel.java	7 Feb 2004 20:23:32 -0000	1.8
  @@ -65,8 +65,6 @@
   
       private final Block m_application;
   
  -    private final Block m_system;
  -
       private final State m_state;
   
       //--------------------------------------------------------------
  @@ -90,23 +88,6 @@
   
           try
           {
  -            ContainmentModel facilities = 
  -              context.getFacilitiesModel();
  -            facilities.assemble();
  -            DefaultBlock system = 
  -              new DefaultBlock( facilities );
  -            system.commission();
  -            m_system = system;
  -        }
  -        catch( Throwable e )
  -        {
  -            final String error = 
  -              "Cannot create system facilities.";
  -            throw new KernelError( error, e );
  -        }
  -
  -        try
  -        {
               m_application = 
                 new DefaultBlock( context.getApplicationModel() );
           }
  @@ -493,21 +474,6 @@
           }
   
           shutdown();
  -
  -        try
  -        {
  -            setState( DECOMMISSIONING );
  -            m_system.decommission();
  -        }
  -        catch( Throwable e )
  -        {
  -            if( getLogger().isWarnEnabled() )
  -            {
  -                final String error =
  -                  "Ignoring block decommissioning error.";
  -                getLogger().warn( error, e );
  -            }
  -        }
   
           m_state.dispose();
       }
  
  
  
  1.4       +2 -15     avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultKernelContext.java
  
  Index: DefaultKernelContext.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultKernelContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultKernelContext.java	24 Jan 2004 23:25:31 -0000	1.3
  +++ DefaultKernelContext.java	7 Feb 2004 20:23:32 -0000	1.4
  @@ -34,21 +34,17 @@
   public class DefaultKernelContext implements KernelContext
   {
       private final Logger m_logger;
  -    private final ContainmentModel m_facilities;
       private final ContainmentModel m_application;
   
      /**
       * Creation of a new default kernel context.
       * @param logger the logging channel to be assigned to the kernel
  -    * @param facilities the internal facilities model
       * @param application the application model
       */
       public DefaultKernelContext( 
  -      final Logger logger, final ContainmentModel facilities, 
  -      final ContainmentModel application )
  +      final Logger logger, final ContainmentModel application )
       {
           m_logger = logger;
  -        m_facilities = facilities;
           m_application = application;
       }
       
  @@ -59,15 +55,6 @@
       public Logger getLogger()
       {
           return m_logger;
  -    }
  -
  -   /**
  -    * Return the facilities model.
  -    * @return the internal container facilities
  -    */
  -    public ContainmentModel getFacilitiesModel()
  -    {
  -        return m_facilities;
       }
   
      /**
  
  
  

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