You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Kjome <ho...@visi.com> on 2002/08/09 23:21:18 UTC

ant task to query if a particular app is running?

Hi,

I'm wondering if it is possible to use one of the catalina ant manager
tasks to query for the existence of a single running application.  The
closest thing to it that I can find is the "List" task.  However, that
just returns a string list of all running apps.

What I would like to do is be able to make my "install" target check
whether an app is already loaded.  If so, instead of just saying
"already installed" and ending the build, it would run the "reload" target.
This would save time....or is it possible to catch some error
condition from the install target and conditionally run the "reload"
target if the install target returns that error condition?  If so, how
is that done?

Note:  I'm sending this mostly Ant question to the Tomcat-user list
only because people like Craig know more about the manager app and the
catalina tasks than the Ant people do.

thanks,

Jake


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ant task to query if a particular app is running?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 9 Aug 2002, Jacob Kjome wrote:

> Date: Fri, 9 Aug 2002 16:21:18 -0500
> From: Jacob Kjome <ho...@visi.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>,
>      Jacob Kjome <ho...@visi.com>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: ant task to query if a particular app is running?
>
> Hi,
>
> I'm wondering if it is possible to use one of the catalina ant manager
> tasks to query for the existence of a single running application.  The
> closest thing to it that I can find is the "List" task.  However, that
> just returns a string list of all running apps.
>

You could always parse the output of task, or use grep to look for the
line with the right context path ...

> What I would like to do is be able to make my "install" target check
> whether an app is already loaded.  If so, instead of just saying
> "already installed" and ending the build, it would run the "reload" target.
> This would save time....or is it possible to catch some error
> condition from the install target and conditionally run the "reload"
> target if the install target returns that error condition?  If so, how
> is that done?
>

Such a facility doesn't exist yet, but would make a nice enhancement.  To
make such a request, the bug tracking system is a good bet:

  http://nagoya.apache.org/bugzilla/

> Note:  I'm sending this mostly Ant question to the Tomcat-user list
> only because people like Craig know more about the manager app and the
> catalina tasks than the Ant people do.

Although it's an Ant-sounding question, the Ant tasks we are talking about
are actually part of Tomcat (nobody on ANT-USER would probably have any
idea what you're talking about), so this is the right place.

Ant lets you plug in your own custom tasks, and we took advantage of that
capability here.

>
> thanks,
>
> Jake
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>