avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-plugin/src/java/org/apache/avalon/merlin/tools MerlinBean.java
Date Fri, 05 Sep 2003 10:00:33 GMT
mcconnell    2003/09/05 03:00:33

  Modified:    merlin   STRUCTURE.TXT maven.xml platform.xml
               merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        DefaultContainmentModel.java
               merlin/merlin-extensions/merlin-jmx/conf block.xml
               merlin/merlin-platform/tutorials/composition/application/impl
                        project.xml
               merlin/merlin-platform/tutorials/composition/location/api
                        project.xml
               merlin/merlin-platform/tutorials/composition/location/impl
                        project.xml
               merlin/merlin-platform/tutorials/composition/publisher/api
                        project.xml
               merlin/merlin-platform/tutorials/composition/publisher/impl
                        project.xml
               merlin/merlin-plugin/src/java/org/apache/avalon/merlin/tools
                        MerlinBean.java
  Log:
  Housekeeping.
  
  Revision  Changes    Path
  1.6       +14 -14    avalon-sandbox/merlin/STRUCTURE.TXT
  
  Index: STRUCTURE.TXT
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/STRUCTURE.TXT,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- STRUCTURE.TXT	19 Aug 2003 03:54:49 -0000	1.5
  +++ STRUCTURE.TXT	5 Sep 2003 10:00:32 -0000	1.6
  @@ -15,8 +15,10 @@
       +-- activation               activation implementation
       +-- activation-api           activation API interfaces and classes
       +-- activation-spi           activation SPI interfaces and classes
  -    +-- composition              composition implementation
  -    +-- composition-spi          composition SPI interfaces and classes
  +    +-- composition              composition framework
  +        +- api                   composition API
  +        +- spi                   composition SPI
  +        +- impl                  composition framework implementation
       +-- extension                jar manegement implementation
       +-- extension-spi            jar manegement SPI interfaces and classes
       +-- kernel                   
  @@ -32,26 +34,24 @@
       +-- merlin-platform          site and installation resources
           +- src                   resources used to build a merlin installation
           +- tutorials             several merlin tutorials
  -        +- examples              example applications
  -        +- target
  -           +- docs               generate site documentation
  +        +- examples              example applications (work-in-progress) 
       +-- repository
           +- spi                   resource repository interfaces
           +- impl                  resource repository implementation
       +-- target                   generated build
           +- merlin                the generated installation (see 
                                    build procedure detailed below)
  +        +- docs                  generate site documentation
   
   
   BUILD PROCEDURE:
   ----------------
   
  -The Merlin project requires the Maven project management tool.
  -
  -The merlin-dist goal builds a Merlin installation directory under the 
  +The Merlin project requires the Maven project management tool. 
  +The merlin:install goal builds a Merlin installation directory under the 
   default /target/merlin.
   
  -  $ maven merlin-dist
  +  $ maven merlin:install
   
   Following the creation of an installation you need to declare the environment 
   variable MERLIN_HOME with a value corresponding to the directory in which you
  @@ -66,20 +66,20 @@
   Support for the installation and execution of Merlin as an NT process is 
   now included in the package (refer bin directory) - special thanks to Leif
   for helping to set this up.  When updating an existing installation, the 
  -maven goal merlin-libs invokes the classic merlin-dist and updates your local
  +maven goal merlin:update invokes the classic merlin:install and updates your local
   merlin repository.  This is often convinient if you are frequently updating 
  -the merlin core. 
  +the merlin core.
   
   For additional information please check the documentation and also use the 
  -Avalon Users list (subscription details in the doc).  The merlin-site goal 
  +Avalon Users list (subscription details in the doc).  The merlin:site goal 
   aggregates the sources from across the main Merlin sub-projects to build a 
   consolidated project presentation. The goal should be invoked from the 
   root merlin directory.
   
  -  $ maven merlin-site
  +  $ maven merlin:site
   
   Finally, please keep in mind that while Merlin is nearing completion and 
   readiness for a first release, it should be considered as beta software as 
   APIs are changing, and documentation is evolving.
   
  -SJM 17 August 2003
  +SJM 1 September 2003
  
  
  
  1.51      +24 -32    avalon-sandbox/merlin/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/maven.xml,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- maven.xml	31 Aug 2003 14:37:48 -0000	1.50
  +++ maven.xml	5 Sep 2003 10:00:32 -0000	1.51
  @@ -1,4 +1,4 @@
  -<project default="jar:install-snapshot" xmlns:maven="jelly:maven" xmlns:j="jelly:core"
xmlns:util="jelly:util" xmlns:ant="jelly:ant">
  +<project default="merlin:build" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util"
xmlns:ant="jelly:ant">
   
     <ant:property file="project.properties"/>
     <ant:property name="maven.docs.src" value="${basedir}/merlin-platform/xdocs"/>
  @@ -18,7 +18,7 @@
   
     <goal name="merlin:update">
       <attainGoal name="merlin:clean"/>
  -    <attainGoal name="merlin:dist"/>
  +    <attainGoal name="merlin:install"/>
       <attainGoal name="merlin:site"/>
       <attainGoal name="merlin:tutorials"/>
       <attainGoal name="merlin:package"/>
  @@ -31,8 +31,7 @@
       </copy>
     </goal>
   
  -  <goal name="merlin:demo" 
  -    description="Execute the demo targets." >
  +  <goal name="merlin:demo" description="Execute the demo targets." >
       <maven:reactor
         basedir="${basedir}"
         includes="merlin-platform/tutorials/**/project.xml"
  @@ -42,41 +41,39 @@
         ignoreFailures="false" />
     </goal>
   
  -  <goal name="merlin:dist" 
  -    description="Build the Merlin distribution." >
  +  <goal name="merlin:build" description="Build Merlin." >
   
  -    <ant:mkdir dir="${merlin.build.inst.dir}"/>
  -    <ant:mkdir dir="${merlin.build.inst.dir}/ext"/>
  -    <ant:mkdir dir="${merlin.build.inst.dir}/bin/lib"/>
  -
  -    <!--
  -    Install the sub-project jars (meta, assembly, merlin, etc.)
  -    into the user's local repository and put a copy in the 
  -    build target install directory.
  -    -->
  -    <maven:reactor
  -      basedir="${basedir}"
  +    <!-- build the subprojects -->
  +    <maven:reactor basedir="${basedir}"
         includes="**/project.xml"
  -      excludes="merlin-platform/**,merlin-plugin/**,project.xml,kernel/bootstrap/*,merlin-extensions/**"
  +      excludes="target/**,merlin-platform/**,merlin-plugin/**,project.xml,kernel/bootstrap/*,merlin-extensions/**"
         goals="jar:install-snapshot"
         banner="Installing:"
         ignoreFailures="false" />
       <attainGoal name="merlin:plugin"/>
   
  -    <maven:reactor
  -      basedir="${basedir}"
  +    <!-- build the plugin -->
  +    <maven:reactor basedir="${basedir}"
         includes="kernel/bootstrap/project.xml"
         goals="jar:install"
         banner="Installing:"
         ignoreFailures="false" />
  +
  +  </goal>
  +
  +  <goal name="merlin:install" 
  +    description="Build the Merlin distribution." prereqs="merlin:build">
  +
  +    <ant:mkdir dir="${merlin.build.inst.dir}"/>
  +    <ant:mkdir dir="${merlin.build.inst.dir}/ext"/>
  +    <ant:mkdir dir="${merlin.build.inst.dir}/bin/lib"/>
  +
  +    <!-- import bootstrap jar -->
       <ant:copy 
          file="${basedir}/kernel/bootstrap/target/merlin-bootstrap-1.0.jar" 
          toDir="${merlin.build.inst.dir}/bin/lib"/>
   
  -    <!--
  -    Import the dependent jar files referenced by platform.xml
  -    into the install directory.
  -    -->
  +    <!-- import subproject jar files -->
       <maven:reactor
         basedir="${basedir}"
         includes="platform.xml"
  @@ -84,10 +81,7 @@
         banner="Resolving dependencies:"
         ignoreFailures="false"/>
   
  -    <!--
  -    Copy the xml api jar file to the merlin/ext directory so that it 
  -    will included in the JVM bootstrap process.
  -    -->
  +    <!-- copy the xml api jar file to the merlin/ext directory -->
       <ant:copy 
          file="${merlin.build.inst.dir}/repository/xml-apis/jars/xml-apis-2.0.2.jar" 
          toDir="${merlin.build.inst.dir}/ext"/>
  @@ -100,9 +94,7 @@
          toDir="${merlin.build.inst.dir}/ext"/>
       <delete dir="${merlin.build.inst.dir}/repository/xerces"/>
   
  -    <!--
  -    Add the supporting resources.
  -    -->
  +    <!-- add supporting resources -->
       <ant:copy toDir="${merlin.build.inst.dir}">
         <fileset dir="${basedir}/merlin-platform/src">
           <include name="bin/**/*"/>
  @@ -288,7 +280,7 @@
     </goal>
   
     <goal name="merlin-clean" prereqs="merlin:clean"/>
  -  <goal name="merlin-dist" prereqs="merlin:dist"/>
  +  <goal name="merlin-dist" prereqs="merlin:install"/>
     <goal name="merlin-site" prereqs="merlin:site"/>
     <goal name="merlin-libs" prereqs="merlin:update"/>
   
  
  
  
  1.3       +13 -0     avalon-sandbox/merlin/platform.xml
  
  Index: platform.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/platform.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- platform.xml	1 Sep 2003 02:18:13 -0000	1.2
  +++ platform.xml	5 Sep 2003 10:00:32 -0000	1.3
  @@ -10,6 +10,19 @@
     
     <dependencies>
   
  +    <!-- mx4j dependecies -->
  +
  +    <dependency>
  +      <groupId>mx4j</groupId>
  +      <artifactId>mx4j-jmx</artifactId>
  +      <version>1.1.1</version>
  +    </dependency>
  +    <dependency>
  +      <groupId>mx4j</groupId>
  +      <artifactId>mx4j-tools</artifactId>
  +      <version>1.1.1</version>
  +    </dependency>
  +
       <!-- merlin dependecies -->
   
       <dependency>
  
  
  
  1.2       +8 -5      avalon-sandbox/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
  
  Index: DefaultContainmentModel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultContainmentModel.java	31 Aug 2003 14:30:23 -0000	1.1
  +++ DefaultContainmentModel.java	5 Sep 2003 10:00:32 -0000	1.2
  @@ -269,15 +269,13 @@
       public Model addModel( URL url ) throws ModelException
       {
           ContainmentModel model = createContainmentModel( null, url );
  -        m_models.put( model.getName(), model );
  -        return model;
  +        return addModel( model.getName(), model );
       }
   
       public Model addModel( Profile profile ) throws ModelException
       {
           Model model = null;
           final String name = profile.getName();
  -
           if( profile instanceof ContainmentProfile )
           {
               ContainmentProfile containment = (ContainmentProfile) profile;
  @@ -312,7 +310,11 @@
                   profile.getClass().getName() );
               throw new ModelException( error );
           }
  +        return addModel( name, model );
  +    }
   
  +    private Model addModel( String name, Model model ) throws ModelException
  +    {
           m_models.put( name, model );
           return model;
       }
  @@ -327,9 +329,10 @@
       private DeploymentModel createDeploymentModel( final DeploymentProfile profile ) 
         throws ModelException
       {
  +
           final String name = profile.getName();
           final String partition = getPartition();
  -        final Logger logger = getLogger().getChildLogger( profile.getName() );
  +        final Logger logger = getLogger().getChildLogger( name );
   
           if( getLogger().isDebugEnabled() )
           {
  
  
  
  1.3       +3 -3      avalon-sandbox/merlin/merlin-extensions/merlin-jmx/conf/block.xml
  
  Index: block.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-extensions/merlin-jmx/conf/block.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- block.xml	16 Aug 2003 11:19:48 -0000	1.2
  +++ block.xml	5 Sep 2003 10:00:32 -0000	1.3
  @@ -8,11 +8,11 @@
       <classloader>
         <classpath>
           <repository>
  -          <resource id="avalon-framework:avalon-framework-api" version="4.1.5-dev"/>
  -          <resource id="avalon-framework:avalon-framework-impl" version="4.1.5-dev"/>
  +          <resource id="avalon-framework:avalon-framework-api" version="4.1.5"/>
  +          <resource id="avalon-framework:avalon-framework-impl" version="4.1.5"/>
             <resource id="mx4j:mx4j-jmx" version="1.1.1"/>
             <resource id="mx4j:mx4j-tools" version="1.1.1"/>
  -          <resource id="merlin:merlin-jmx" version="1.0"/>
  +          <resource id="merlin:merlin-jmx" version="SNAPSHOT"/>
           </repository>
         </classpath>
       </classloader>
  
  
  
  1.4       +1 -1      avalon-sandbox/merlin/merlin-platform/tutorials/composition/application/impl/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/composition/application/impl/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	25 Aug 2003 23:39:58 -0000	1.3
  +++ project.xml	5 Sep 2003 10:00:32 -0000	1.4
  @@ -5,7 +5,7 @@
     <extend>${basedir}/../../../project.xml</extend>
   
     <id>application-impl</id>
  -  <name>Composition Application</name>
  +  <name>Composition Application Tutorial</name>
     <currentVersion>1.0</currentVersion>
   
     <dependencies>
  
  
  
  1.4       +1 -1      avalon-sandbox/merlin/merlin-platform/tutorials/composition/location/api/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/composition/location/api/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	25 Aug 2003 23:39:58 -0000	1.3
  +++ project.xml	5 Sep 2003 10:00:32 -0000	1.4
  @@ -5,7 +5,7 @@
     <extend>${basedir}/../../../project.xml</extend>
   
     <id>locator-api</id>
  -  <name>Composition Locator API</name>
  +  <name>Composition Locator API Tutorial</name>
     <currentVersion>1.0</currentVersion>
   
     <dependencies>
  
  
  
  1.4       +1 -1      avalon-sandbox/merlin/merlin-platform/tutorials/composition/location/impl/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/composition/location/impl/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	25 Aug 2003 23:39:58 -0000	1.3
  +++ project.xml	5 Sep 2003 10:00:32 -0000	1.4
  @@ -5,7 +5,7 @@
     <extend>${basedir}/../../../project.xml</extend>
   
     <id>locator-impl</id>
  -  <name>Composition Locator Impl</name>
  +  <name>Composition Locator Impl Tutorial</name>
     <currentVersion>1.0</currentVersion>
   
     <dependencies>
  
  
  
  1.4       +1 -1      avalon-sandbox/merlin/merlin-platform/tutorials/composition/publisher/api/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/composition/publisher/api/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	25 Aug 2003 23:39:58 -0000	1.3
  +++ project.xml	5 Sep 2003 10:00:32 -0000	1.4
  @@ -5,7 +5,7 @@
     <extend>${basedir}/../../../project.xml</extend>
   
     <id>publisher-api</id>
  -  <name>Composition Publisher API</name>
  +  <name>Composition Publisher API Tutorial</name>
     <currentVersion>1.0</currentVersion>
   
     <dependencies>
  
  
  
  1.4       +1 -1      avalon-sandbox/merlin/merlin-platform/tutorials/composition/publisher/impl/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/composition/publisher/impl/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	25 Aug 2003 23:39:58 -0000	1.3
  +++ project.xml	5 Sep 2003 10:00:33 -0000	1.4
  @@ -5,7 +5,7 @@
     <extend>${basedir}/../../../project.xml</extend>
   
     <id>publisher-impl</id>
  -  <name>Composition Publisher Impl</name>
  +  <name>Composition Publisher Impl Tutorial</name>
     <currentVersion>1.0</currentVersion>
   
     <dependencies>
  
  
  
  1.16      +38 -3     avalon-sandbox/merlin/merlin-plugin/src/java/org/apache/avalon/merlin/tools/MerlinBean.java
  
  Index: MerlinBean.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-plugin/src/java/org/apache/avalon/merlin/tools/MerlinBean.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MerlinBean.java	25 Aug 2003 16:38:42 -0000	1.15
  +++ MerlinBean.java	5 Sep 2003 10:00:33 -0000	1.16
  @@ -229,6 +229,15 @@
       }
   
      /**
  +    * Get the repository directory fiile.
  +    * @return the repository directory
  +    */
  +    private File getRepositoryDirectory()
  +    {
  +        return m_repository;
  +    }
  +
  +   /**
       * Get the configuration source as a URL
       * @return the config url
       */
  @@ -312,14 +321,15 @@
       */
       public void doExecute() throws Exception
       {
  +        DefaultKernelContext context = null;
           try
           {
               File repo = new File( m_repository, "repository" );
               Repository repository = new DefaultFileRepository( repo );
  -            DefaultKernelContext context = 
  +            context = 
                 new DefaultKernelContext( 
                   repository, 
  -                m_repository, 
  +                getRepositoryDirectory(), 
                   getAnchorDirectory(), 
                   getHomeDirectory(), 
                   getKernelURL(), 
  @@ -329,14 +339,39 @@
                   getInfoFlag(),
                   getDebugFlag() 
                 );
  +        }
  +        catch( Throwable e )
  +        {
  +            final String error = 
  +              "Could not establish the kernel context.";
  +            String message = ExceptionHelper.packException( error, e );
  +            System.err.println( message );
  +            throw new KernelException( message, e );
  +        }
   
  -            Kernel kernel = new DefaultKernel( context );
  +        Kernel kernel = null;
  +        try
  +        {
  +            kernel = new DefaultKernel( context );
               setShutdownHook( kernel );
           }
           catch( Throwable e )
           {
               final String error = 
                 "Could not establish the kernel.";
  +            String message = ExceptionHelper.packException( error, e );
  +            System.err.println( message );
  +            throw new KernelException( message, e );
  +        }
  +
  +        try
  +        {
  +            kernel.startup();
  +        }
  +        catch( Throwable e )
  +        {
  +            final String error = 
  +              "Kernel startup failure.";
               String message = ExceptionHelper.packException( error, e );
               System.err.println( message );
               throw new KernelException( message, e );
  
  
  

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


Mime
View raw message