ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject Re: Task connection cleanup
Date Sun, 08 Jun 2003 09:07:36 GMT
The idea with the BuildListener is OK.
A task in ant is simply a public class with a public void execute() method
in in it.
Tasks are identified as such when they are in the file
of org/apache/tools/ant/taskdefs or when you use the <taskdef/> task to
introduce them.
So, yes, you certainly can create a listener class which is also a task.
What you also can do is create a disconnection task and separately a
listener which calls the disconnection task when the build is finished (with
success or failure).
The MailLogger is a logger which is taking action in the same circumstances
like the one you want to have (success or failure of the build).
The only point to pay attention on : it is unspecified what happens when a
listener delegates to a task which itself wants to use ant's logging system.
----- Original Message -----
From: "David Morris" <>
To: <>
Sent: Sunday, June 08, 2003 1:23 AM
Subject: Task connection cleanup

> I created an Ant task that opens a shared connection that needs to be
> cleaned up at the end of a build. So far, I have come up with three
> ideas:
> 1. Wrap the task(s) in a connection task.
> 2. Cleanup on finalize.
> 3. Use a build listener and somehow register the connection for cleanup
> (can a task implement a BuildListener?)
> I would appreciate any comments on these ideas or alternative
> suggestions.
> Thanks,
> David Morris
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message