ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: task & class loader question
Date Wed, 22 Aug 2001 05:24:19 GMT
On Tue, 21 Aug 2001, Gary Shea <> wrote:

> I don't know a thing about classloaders, and there's only one
> example of AntClassLoader being used in the taskdefs (SQLExec) so
> I'm wondering if I'm on the right track or not...

Hmm, take a look at Definer (used to be Taskdef in 1.3), Java or
JUnitTask for other examples.

> Is there a writeup somewhere that I've missed?

Nope, apart from the Javadocs there is nothing.

> Am I right that the main thing to watch out for is having the same
> class loaded by two different classloaders?

Java expects each classloader to consult the "parent" class loader
before looking up the class itself, so most of the time you won't load
the same class via different classloader - but if that happens, things
are going to become, errm, difficult.

> So as long as the classloader does the pass-it-to-the-parent-first
> thing, adding a classloader with unique jars and classes is no big
> deal?



View raw message