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 Tue, 19 Aug 2003 07:34:31 GMT
mcconnell    2003/08/19 00:34:31

  Modified:    merlin/composition/src/java/org/apache/avalon/composition/logging/impl
                        DefaultLoggingManager.java
               merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl
                        CLIKernelLoader.java DefaultKernel.java
                        DefaultKernelContext.java
               merlin/merlin-platform/tutorials/contextualization maven.xml
               merlin/merlin-plugin plugin.jelly plugin.properties
               merlin/merlin-plugin/src/java/org/apache/avalon/merlin/tools
                        MerlinBean.java
  Log:
  Housekeeping.
  
  Revision  Changes    Path
  1.5       +5 -3      avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/logging/impl/DefaultLoggingManager.java
  
  Index: DefaultLoggingManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/logging/impl/DefaultLoggingManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultLoggingManager.java	18 Aug 2003 11:26:05 -0000	1.4
  +++ DefaultLoggingManager.java	19 Aug 2003 07:34:30 -0000	1.5
  @@ -245,13 +245,15 @@
               CategoryDirective category = categories[i];
               final String priority = category.getPriority();
               final String target = category.getTarget();
  +            final String name = filter( category.getName() );
               if( path.equals( "" ) )
               {
  -                addCategory( category.getName(), priority, target );
  -            } 
  +                addCategory( name, priority, target );
  +            }
               else
               {
  -                addCategory( path + "." + category.getName(), priority, target );
  +                final String base = filter( path + "." + name );
  +                addCategory( base, priority, target );
               }
           }
       }
  
  
  
  1.8       +0 -11     avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/CLIKernelLoader.java
  
  Index: CLIKernelLoader.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/CLIKernelLoader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CLIKernelLoader.java	19 Aug 2003 05:45:15 -0000	1.7
  +++ CLIKernelLoader.java	19 Aug 2003 07:34:30 -0000	1.8
  @@ -129,17 +129,6 @@
           }
   
           //
  -        // if the debug flag is enabled then print the context object
  -        //
  -
  -        if( context.getDebugFlag() )
  -        {
  -            System.out.println( "");
  -            System.out.println( context.toString() );
  -            System.out.println( "");
  -        }
  -
  -        //
           // ready to roll -
           // create the kernel and set a shutdown hook
           //
  
  
  
  1.6       +4 -2      avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultKernel.java	18 Aug 2003 11:26:05 -0000	1.5
  +++ DefaultKernel.java	19 Aug 2003 07:34:30 -0000	1.6
  @@ -241,7 +241,7 @@
           {
               if( m_block instanceof Composite )
               {
  -                getLogger().info( "assembly phase" );
  +                getLogger().debug( "assembly phase" );
                   ((Composite)m_block).assemble();
               }
           }
  @@ -273,6 +273,8 @@
               }
               else if( !context.getServerFlag() )
               {
  +                // TODO: add pause parameter
  +
                   shutdown();
               }
           }
  
  
  
  1.11      +31 -16    avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelContext.java
  
  Index: DefaultKernelContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelContext.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultKernelContext.java	19 Aug 2003 05:45:15 -0000	1.10
  +++ DefaultKernelContext.java	19 Aug 2003 07:34:30 -0000	1.11
  @@ -63,6 +63,7 @@
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.composition.data.builder.XMLDeploymentProfileCreator;
  @@ -219,14 +220,15 @@
           m_home = new File( home, "home" );
           m_temp = new File( System.getProperty( "java.io.tmpdir" ) );
   
  -        m_kernelURL = kernel;
           if( kernel != null )
           {
  +            m_kernelURL = kernel;
               m_kernel = getKernelConfiguration( kernel );
           }
           else
           {
  -            m_kernel = getKernelConfiguration( loadKernelDirective( repository ) );
  +            m_kernelURL = loadKernelDirective( repository );
  +            m_kernel = getKernelConfiguration( m_kernelURL );
           }
   
           m_debug = debug;
  @@ -304,6 +306,15 @@
                 "Unexpected exception while creating internal model factory.";
               throw new KernelException( error, e );
           }
  +
  +        //
  +        // if the debug flag is enabled then print the context object
  +        //
  +
  +        if( getDebugFlag() )
  +        {
  +            getLogger().info( "\n" + toString() + "\n" );
  +        }
       }
   
       private Repository createRepository( File root, Configuration config ) 
  @@ -544,15 +555,15 @@
   
       public String toString()
       {
  -        StringBuffer buffer = new StringBuffer( "version: " );
  -        buffer.append( getVersionString() );
  -        buffer.append( "\nhome: " + getHomePath() );
  -        buffer.append( "\nsystem: " + m_system );
  -        buffer.append( "\nlibrary: " + getLibraryPath() );
  -        buffer.append( "\nkernel: " + m_kernelURL );
  -        buffer.append( "\nblock: " + getInstallSequenceString() );
  -        buffer.append( "\noverride: " + getOverrideDirective() );
  -        buffer.append( "\ndebug: " + getDebugFlag() );
  +        StringBuffer buffer = new StringBuffer( "  version: " );
  +        buffer.append( "  " + getVersionString() );
  +        buffer.append( "\n  home: " + getHomePath() );
  +        buffer.append( "\n  system: " + m_system );
  +        buffer.append( "\n  library: " + getLibraryPath() );
  +        buffer.append( "\n  kernel: " + m_kernelURL );
  +        buffer.append( "\n  block: " + getInstallSequenceString() );
  +        buffer.append( "\n  override: " + getOverrideDirective() );
  +        buffer.append( "\n  debug: " + getDebugFlag() );
           return buffer.toString();
       }
   
  @@ -582,6 +593,12 @@
       private Configuration getKernelConfiguration( final URL url )
         throws KernelException
       {
  +        if( url == null )
  +        {
  +           return new DefaultConfiguration( 
  +             "kernel", DefaultKernelContext.class.getName() );
  +        }
  +
           try
           {
               DefaultConfigurationBuilder builder = 
  @@ -651,7 +668,7 @@
           Configuration config )
           throws KernelException
       {
  -        final String name = config.getAttribute( "name", "" );
  +        final String name = config.getAttribute( "name", "smp" );
           CategoriesDirective categories = null;
           try
           {
  @@ -763,9 +780,7 @@
               }
               catch( Throwable e )
               {
  -                final String error = 
  -                  "Could not load default kernel directive.";
  -                throw new KernelException( error, e );
  +                return null;
               }
           }
       }
  
  
  
  1.3       +6 -3      avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/maven.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- maven.xml	19 Aug 2003 05:45:15 -0000	1.2
  +++ maven.xml	19 Aug 2003 07:34:30 -0000	1.3
  @@ -1,11 +1,14 @@
  -<project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util">
  +<project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util"
xmlns:ant="jelly:ant">
   
  +  <ant:property file="project.properties"/>
  +  
     <preGoal name="java:compile">
       <attainGoal name="avalon:meta"/>
     </preGoal>
   
  -  <postGoal name="test:test">
  +  <goal name="validate">
  +    <attainGoal name="test:test"/>
       <attainGoal name="merlin:simulate"/>
  -  </postGoal>
  +  </goal>
   
   </project>
  
  
  
  1.22      +25 -11    avalon-sandbox/merlin/merlin-plugin/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-plugin/plugin.jelly,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- plugin.jelly	19 Aug 2003 05:46:25 -0000	1.21
  +++ plugin.jelly	19 Aug 2003 07:34:30 -0000	1.22
  @@ -5,6 +5,7 @@
     xmlns:util="jelly:util"
     xmlns:maven="jelly:maven"
     xmlns:ant="jelly:ant"
  +  xmlns:log="jelly:log"
     xmlns:merlin="merlin">
   
     <define:taglib uri="merlin">
  @@ -27,7 +28,7 @@
       defintion will hold.
       -->
       <ant:property environment="env"/>
  -    <j:set var="merlin.system" value="${env.MERLIN_HOME}"/>
  +    <j:set var="merlin.system" value="${basedir}"/>
       <j:set var="merlin.system.dir" value="${merlin.system}"/>
       <util:file var="sys" name="${merlin.system.dir}"/>
       <j:if test="${sys.exists()}">
  @@ -55,16 +56,23 @@
       Declare the default configuration path which will be overriden
       if an merlin.block.config property is set and exists.
       -->
  -    <j:set var="merlin.config" value="${basedir}/conf/config.xml"/>
  +    <j:set var="merlin.config" value="${maven.conf.dir}/config.xml"/>
       <j:set var="merlin.block.config" value="${merlin.config}"/>
       <util:file var="configFile" name="${merlin.block.config}"/>
       <j:if test="${configFile.exists()}">
         <j:set var="merlin.config" value="${merlin.block.config}"/>
       </j:if>
   
  -    <j:set var="merlin.debug" value="${merlin.kernel.debug}"/>
  -    <j:if test="${merlin.debug == null}">
  -      <j:set var="merlin.debug" value="WARN"/>
  +    <j:if test="${context.getVariable('merlin.debug') == null}">
  +      <j:set var="merlin.debug" value="false"/>
  +    </j:if>
  +    <j:if test="${context.getVariable('merlin.debug') != null}">
  +      <j:if test="${context.getVariable('merlin.debug') == 'true'}">
  +        <j:set var="merlin.debug" value="true"/>
  +      </j:if>
  +      <j:if test="${context.getVariable('merlin.debug') != 'true'}">
  +        <j:set var="merlin.debug" value="false"/>
  +      </j:if>
       </j:if>
   
       <j:set var="wait" value="${merlin.kernel.wait}"/>
  @@ -94,7 +102,6 @@
       directive and a base directory contining classes are related artifacts.">
   
       <echo>Merlin simulated deployment.</echo>
  -    <echo>Block: ${maven.conf.dir}/block.xml</echo>
   
       <!--
       Assign a value to the merlin.system.dir variable.  If the 
  @@ -102,8 +109,8 @@
       defintion will hold.
       -->
       <ant:property environment="env"/>
  -    <j:set var="merlin.system" value="${env.MERLIN_HOME}"/>
  -    <j:set var="merlin.system.dir" value="${env.MERLIN_HOME}"/>
  +    <j:set var="merlin.system" value="${basedir}"/>
  +    <j:set var="merlin.system.dir" value="${merlin.system}"/>
       <util:file var="sys" name="${merlin.system.dir}"/>
       <j:if test="${sys.exists()}">
         <j:set var="merlin.system" value="${merlin.system.dir}"/>
  @@ -137,9 +144,16 @@
         <j:set var="merlin.config" value="${merlin.block.config}"/>
       </j:if>
   
  -    <j:set var="merlin.debug" value="${merlin.kernel.debug}"/>
  -    <j:if test="${merlin.debug == null}">
  -      <j:set var="merlin.debug" value="WARN"/>
  +    <j:if test="${context.getVariable('merlin.debug') == null}">
  +      <j:set var="merlin.debug" value="false"/>
  +    </j:if>
  +    <j:if test="${context.getVariable('merlin.debug') != null}">
  +      <j:if test="${context.getVariable('merlin.debug') == 'true'}">
  +        <j:set var="merlin.debug" value="true"/>
  +      </j:if>
  +      <j:if test="${context.getVariable('merlin.debug') != 'true'}">
  +        <j:set var="merlin.debug" value="false"/>
  +      </j:if>
       </j:if>
   
       <j:set var="wait" value="${merlin.kernel.wait}"/>
  
  
  
  1.4       +21 -14    avalon-sandbox/merlin/merlin-plugin/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-plugin/plugin.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- plugin.properties	16 Jun 2003 08:32:03 -0000	1.3
  +++ plugin.properties	19 Aug 2003 07:34:30 -0000	1.4
  @@ -5,27 +5,34 @@
   # -------------------------------------------------------------------
   
   #
  -# Policy controlling the regeneration of meta descriptors independently
  -# of the descriptor data.  This value defaults to false.  
  +# The relative of absolute directory path that will for the anchor
  +# for the defintion of relative directory references used in option
  +# extension directory establishment.  The default value is ${basedir}.
   #
  -merlin.meta.force=false
  +#merlin.anchor.dir
   
   #
  -# Output format specification.  Valid values include 'xml' or 'serial'.
  -# The xml value instructs the meta generator to create meta descriptions
  -# in an XML format whereas the 'serial' value generates a serialized 
  -# description of the descriptor.  Serial format is more efficient.  The 
  -# default XML format is more portable.
  +# Relative or absolute directory of the local repository directory.
  +# The default value is the Maven local repository directory.
   #
  -merlin.meta.format=xml
  +#merlin.repository.local
   
   #
  -# When generating type descriptors, Merlin recognizes both <classname>.xinfo
  -# and <classname>.xtype. The .xtype postfix is used in situations where 
  -# developers want to generate both Merlin and Phoenix descriptors. The 
  -# value default to xinfo.
  +# Relative or absolute file path to the kernel configuration.  
  +# The default value corresponds to the path ${maven.conf.dir}/kernel.xml.
   #
  -merlin.meta.type.postfix=xinfo
  +#merlin.kernel
  +
  +#
  +# Relative or absolute file path to the target override configuration.  
  +# The default value corresponds to the path ${maven.conf.dir}/config.xml.
  +#
  +#merlin.config
  +
  +#
  +# Merlin debug flag.
  +#
  +merlin.debug=false
   
   
   
  
  
  
  1.12      +18 -13    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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MerlinBean.java	19 Aug 2003 05:45:15 -0000	1.11
  +++ MerlinBean.java	19 Aug 2003 07:34:31 -0000	1.12
  @@ -119,14 +119,14 @@
       private String m_debug;
   
      /**
  -    * ??
  +    * Execution model flag.
       */
  -    private boolean m_deploy = true;
  +    private boolean m_execute = true;
   
      /**
  -    * ??
  +    * Shutdown pause.
       */
  -    private int m_wait = 0;
  +    private int m_wait = 0; // not used
   
      /**
       * the kernel
  @@ -146,8 +146,11 @@
           m_repository = repository;
       }
   
  -    //??
  -    public void setWait( int value ) 
  +   /**
  +    * Set the pause between deployment and decommissioning when 
  +    * executing in non-server model.
  +    */
  +    public void setWait( int value ) // not used
       {
           m_wait = value;
       }
  @@ -200,7 +203,7 @@
       */
       public void setDeploy( boolean value ) 
       {
  -        m_deploy = value;
  +        m_execute = value;
       }
   
       //-----------------------------------------------------
  @@ -232,7 +235,7 @@
      /**
       * The intival of time to wait before shutting down the kernel.  
       */
  -    public int getWait() 
  +    public int getWait() // not used
       {
           return m_wait;
       }
  @@ -260,12 +263,12 @@
       }
   
      /**
  -    * Return the deployment flag.
  +    * Return the execute mode flag.
       * @return the flag
       */
  -    public boolean getDeployFlag( ) 
  +    public boolean getExecuteFlag( ) 
       {
  -        return m_deploy;
  +        return m_execute;
       }
   
      /**
  @@ -286,6 +289,9 @@
           return m_debug.equalsIgnoreCase( "true" );
       }
   
  +   /**
  +    * Establish the merlin kernel.
  +    */
       public void doExecute() throws Exception
       {
           try
  @@ -300,12 +306,11 @@
                   getKernelURL(), 
                   new URL[]{ getTarget() },
                   getConfigurationURL(), 
  -                getDeployFlag(), 
  +                getExecuteFlag(), 
                   getDebugFlag() 
                 );
   
               m_kernel = new DefaultKernel( context );
  -
           }
           catch( Throwable e )
           {
  
  
  

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


Mime
View raw message