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/05/08 05:55:57 UTC

cvs commit: avalon-sandbox/merlin/merlin-plugin/src/java/org/apache/avalon/merlin/tools MerlinBean.java

mcconnell    2003/05/07 20:55:57

  Modified:    merlin/merlin-plugin plugin.jelly
               merlin/merlin-plugin/src/java/org/apache/avalon/merlin/tools
                        MerlinBean.java
  Log:
  Addition of support for declaration of compoent deployment wait period when lauching Merlin from Maven.
  
  Revision  Changes    Path
  1.3       +12 -1     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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly	8 May 2003 03:02:40 -0000	1.2
  +++ plugin.jelly	8 May 2003 03:55:57 -0000	1.3
  @@ -88,6 +88,11 @@
         <j:set var="merlin.debug" value="DEBUG"/>
       </j:if>
   
  +    <j:set var="wait" value="${merlin.kernel.wait}"/>
  +    <j:if test="${wait == null}">
  +      <j:set var="wait" value="1000"/>
  +    </j:if>
  +
       <!--
       Launch Merlin with the supplied system, kernel, target and config
       paths and internal debug priority.
  @@ -99,6 +104,7 @@
         target="${maven.build.dir}/${maven.final.name}.jar" 
         config="${merlin.config}" 
         debug="${merlin.debug}" 
  +      wait="1000" 
       />
   
     </goal>
  @@ -147,6 +153,11 @@
         <j:set var="merlin.debug" value="DEBUG"/>
       </j:if>
   
  +    <j:set var="wait" value="${merlin.kernel.wait}"/>
  +    <j:if test="${wait == null}">
  +      <j:set var="wait" value="1000"/>
  +    </j:if>
  +
       <!--
       Launch Merlin with the supplied system, kernel, target and config
       paths and internal debug priority.
  @@ -159,7 +170,7 @@
         base="${basedir}/target/classes" 
         config="${merlin.config}" 
         debug="${merlin.debug}" 
  -      deploy="false" 
  +      wait="${wait}" 
       />
   
     </goal>
  
  
  
  1.2       +9 -17     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MerlinBean.java	8 May 2003 03:02:40 -0000	1.1
  +++ MerlinBean.java	8 May 2003 03:55:57 -0000	1.2
  @@ -87,6 +87,7 @@
       private File m_home;
       private String m_debug;
       private boolean m_deploy = true;
  +    private int m_wait = 0;
   
       private Kernel m_kernel;
   
  @@ -112,6 +113,12 @@
           m_path = path;
       }
   
  +    public void setWait( int value ) 
  +    {
  +        m_wait = value;
  +    }
  +
  +
       private URL getPath()
       {
           try
  @@ -280,23 +287,8 @@
               throw new KernelException( message, e );
           }
   
  -        if( m_deploy )
  -        {
  -            Block block = m_kernel.getRootBlock();
  -            try
  -            {
  -                block.deploy();
  -            }
  -            catch( Throwable e )
  -            {
  -                final String error = 
  -                  "Deployment failure.";
  -                String message = ExceptionHelper.packException( error, e );
  -                System.err.println( message );
  -                m_kernel.shutdown();
  -                throw new KernelException( message, e );
  -            }
  -        }
  +        Thread.currentThread().sleep( m_wait );
  +
           m_kernel.shutdown();
       }
   
  
  
  

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