ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <>
Subject RE: Classloader question
Date Thu, 11 Oct 2001 00:46:17 GMT
> From: Geir Magnusson Jr. []
> On 10/10/01 7:32 AM, "Conor MacNeill"
> <> wrote:
> >
> >
> > Well, the AntClassLoader provides methods to set and restore the context
> > loader of the current thread so that part is relatively easy. It uses
> > reflection so may not be the fastest routine. The main problem though is
> > that there is not a single classloader for tasks but, potentially, one
> > for each taskdef.
> Why is that a problem?

It means the various loaders need to be swapped in and out as the different
task's are accessed. It is not as simple as doing it once.

> > Also tasks can be accessed in a variety of ways.
> > Presumably, whenever the task is accessed, its loader would need to be
> > set and then later restored.
> I don't understand this model.  What is the use case where it is
> 'accessed'
> more than once?

Well the accesses that are possible would be
1. setters being called by the core. Presumably these can all be done
2. the execute method - not too much of a problem
3. setters called by other tasks

3 is the problem since responsibility for setting the context loader moves
from the core to the task doing the calling. We could say that the context
loader will be set for the execute method but not for the setter methods.

> What I assume you mean is that if a taskdef is used multiple times


>  - in
> which case I would argue that you want to toss the thing out and start
> again.

Yes, we call it Ant2 :-)

> I say that as I think of each ant task usage as a
> separate 'process'
> that isn't tied to any other calls to that task (process).

That is true but is not what I meant.


View raw message