ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Loehr, Ruel" <rlo...@pointserve.com>
Subject RE: Ant & JBoss - How to check conditions?
Date Fri, 04 Jan 2008 16:02:34 GMT

Here is an alternative.


  <target name="stop-jboss" depends="init" description="stop jboss">
    <exec dir="${JBossHome}/bin" executable="shutdown.bat" failonerror="no" timeout="2000"
vmlauncher="false">
      <arg value="localhost"/>
      <arg value="80"/>
    </exec>
    <echo>JBoss has shutdown</echo>
  </target>


Just call the shutdown script.   No need to mess with jmx.  If jobss is n't running I have
no idea how you are going to access a jmx Boolean flag.....

If you want to get fancy, you can inspect the shutdown.bat file and find out what class it
is calling and the just call it via a java call.


R


-----Original Message-----
From: serdsch [mailto:sergio.weigel@evodion.de]
Sent: Friday, January 04, 2008 9:59 AM
To: user@ant.apache.org
Subject: Ant & JBoss - How to check conditions?


I want to write an Ant script that shuts down a JBoss server if it is
running. I know how to access the JMX console via the calls on the Twiddle
tool in Ant. I also know that there is a class in JBoss representing the
server itself:

jboss.system:service=Server

that has a boolean flag called "Started" that is set to "true" if JBoss is
running. I'm not familiar yet how to write conditional Ant scripts, but I
know there are tags like <condition> to do that. My question really is, how
can I access the value of that flag "Started"? How can I have access to Java
objects during runtime?

Thx a lot, Sergio
--
View this message in context: http://www.nabble.com/Ant---JBoss---How-to-check-conditions--tp14619384p14619384.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message