[jboss-svn-commits] JBL Code SVN: r33908 - labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/server-controller.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 15 13:49:49 EDT 2010


Author: whitingjr
Date: 2010-07-15 13:49:49 -0400 (Thu, 15 Jul 2010)
New Revision: 33908

Modified:
   labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/server-controller/server-api.xml
Log:
Changed the script to generate a pid file only.
Renamed the target.

Modified: labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/server-controller/server-api.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/server-controller/server-api.xml	2010-07-15 17:37:44 UTC (rev 33907)
+++ labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/server-controller/server-api.xml	2010-07-15 17:49:49 UTC (rev 33908)
@@ -39,7 +39,7 @@
       <exec executable="${shutdown.command}" output="/dev/null">
          <arg value="--server=hornetq:1100"/>
       </exec>
-      <sleep seconds="10"/>
+      <sleep minute="1"/>
    
    </target>
    
@@ -57,11 +57,31 @@
       <delete file="${sever.home}/${jstat.command.arguments.7}" failonerror="false"/>
    </target>
    
-   <target name="start-jstat">
+   <target name="create-server-pid">
       <delete file="${jps.output.file}"/>
       <groovy>
          import org.apache.commons.lang.StringUtils;
-         pid = "jps".execute().text.eachLine { it.contains("${properties['process.name']}") }.tokenize(" ").first()
+         searchStr = "${properties['process.name']}"
+         
+         pid = ""
+          
+         jpsOutput = "jps".execute().text
+         tokenisedList = jpsOutput.tokenize()
+         num = tokenisedList.count(searchStr)
+         
+         if (1 == num)
+         {
+            jpsMapped = new HashMap()
+            loopCount = (tokenisedList.size()/2)
+            while ( loopCount-- > 0 )
+            {
+               key = tokenisedList.pop()
+               jpsMapped.put(key, tokenisedList.pop())
+            }
+            jpsMapped.eachWithIndex() { obj, i -> println " ${i}: ${obj}" };
+            pid = jpsMapped.getAt(searchStr)
+         }
+         
          if (StringUtils.isNotBlank(pid))
          {
             def pidFile = new File("${properties['jps.output.file']}")
@@ -69,27 +89,9 @@
             pidFile.append(pid)
             pidFile.append('\n')
          }
-         println pid
       </groovy>
-      <condition property="server.isStarted">
-         <available file="${jps.output.file}"/>
-      </condition>
-      <antcall target="jstat"/>
    </target>
    
-   <target name="jstat" if="server.isStarted">
-      <property file="${jps.output.file}" />
-      <exec executable="jstat" spawn="true">
-         <arg value="${jstat.command.arguments.1}"/>
-         <arg value="${jstat.command.arguments.2}"/>
-         <arg value="${jstat.command.arguments.3}"/>
-         <arg value="${process.pid}"/>
-         <arg value="${jstat.command.arguments.5}"/>
-         <arg value="${jstat.command.arguments.6}"/>
-         <arg value="${sever.home}/${jstat.command.arguments.7}"/>
-      </exec>
-   </target>
-   
    <target name="usage">
       <message echo="Do not call this Ant file directly. Use the commands file instead."/>
    </target>



More information about the jboss-svn-commits mailing list