ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: pingURL: A better way to start and stop application servers?
Date Wed, 12 Feb 2003 07:04:08 GMT
ASAIK there are plans (ideas? wishes?) on the Dev-List for realizing
a async-option (or task) for <java>, <exec> and <apply>.

But I´m not sure - especially when it will be done.


Jan Matèrne

-----Ursprüngliche Nachricht-----
Von: Philip Aston [mailto:paston@bea.com]
Gesendet am: Dienstag, 11. Februar 2003 15:48
An: Ant Users List
Betreff: Re: pingURL: A better way to start and stop application
servers?



Philip Aston writes last April:
 > [old thread, I've been busy]

Positively historic now.

 > Steve Loughran writes:
 >  > You can use <waitfor> to probe a url with controlled sleep time
 >  > and timeout interval, sets a property on success, etc.
 >  > 
 >  > All pingurl does is add a container wrapper, but it only allows
 >  > url 2XX conditions to be evaluated (presumably); <waitfor> can
 >  > probe any port for being openable, plus all the other conditions
 >  > that are possible
 > 
 > Yep, waitfor is more generic and wins. Roll on 1.5 :-)

I _finally_ got around to trying this. I used something like:

      <target name="start-server">
	<parallel>
	  <sequential>
	    <java><!-- start server --></java>
	  </sequential>

	  <waitfor><http url="http://localhost:7001/"/></waitfor>
	</parallel>
      </target>

However, this doesn't do the same as:

      <target name="start-server">
	 <pingURL testURL="http://localhost:7001/" waitUntil="alive">
	   <java><!-- start server --></java>
         </pingURL>
      </target>

The difference between the two is that the <parallel> construct does
not exit until the server exits, whereas pingURL launches the "start
server" work in its own thread. With pingURL I can have my unit test
targets depend on start-server. AFAICS, I can't achieve the same with
standard ANT tasks.

As a random suggestion, perhaps there could be a "asynchronous" option
for <java> so you could do:

   <java asynchronous="true"><!-- start server --></java>
   <waitfor><http url="http://localhost:7001/"/></waitfor>

Any comments?

- Phil


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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message