ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs
Date Wed, 19 Jul 2000 18:15:14 GMT
Conor MacNeill wrote:
> I have written a classloader for Ant. I'd appreciate any feedback on it.

Related, re. the no-fork mode of the Java task: note that if you are
willing to write some extra code, it is possible to trap System.exit
calls made from within the executed task and have them only terminate
that task, not the Ant VM. This is very useful for wrapping around
existing Java apps.

Basically, you need to install a security manager that checks exit
"permission"; also examine the calling stack to see what is happening,
and if inside the no-fork Java task, throw a special SecurityException
subclass with the intended exit code. The task impl can then catch this
exception and deal with it politely. Messy but it works. For example


Jesse Glick   <>
NetBeans, Open APIs  <>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR

View raw message