ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: <delete> task for antlib jars
Date Fri, 13 Feb 2004 15:49:20 GMT
> From: Dominique Devienne [] 
> > From: Jose Alberto Fernandez []
> > Why does the antlib file or JAR would stay open beyond loading the 
> > classes and reading the antlib.xml?
> > 
> > Maybe what is needed here, is a way to tell ALL AntClassLoaders to 
> > please close their open files (JARS) and reopen if needed later.
> > 
> > After all, keeping the JARs open is just an optimization.
> Well, after reading the antlib.xml, sure you could close the 
> JAR, but once a URLClassLoader from the JDK starts using 
> classes from the JAR (and most likely even before that), that 
> JAR will stay open so it's not swapped under the JVM. I know 
> for sure the Linux JVM memory-maps those JARs in the process 
> address space, and it's very possible the Windows VM does 
> something similar (thus the lock on the JAR file).
> I'm not sure Ant wants to go into the business of writing 
> some custom ClassLoader that would not exhibit this 
> 'standard' behavior of SUN's JDKs...

We already wrote a Custom classloader, and it already exhibit
non-standard behavior. And they are already registered at least 
as an event listener. So they could as well register for
a "please close your files" events as well.

If the file disapears and classes cannot be loaded after that,
then it should just throw a ClassNotFoundException or whatever.

Jose Alberto

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

View raw message