ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject Re: PATCH: taskdefs and class loaders
Date Wed, 18 Jul 2001 14:59:13 GMT
From: "Stefan Bodewig" <bodewig@apache.org>
To: <ant-dev@jakarta.apache.org>
Sent: Thursday, July 19, 2001 12:42 AM
Subject: Re: PATCH: taskdefs and class loaders


> On Wed, 18 Jul 2001, Conor MacNeill <conor@cortexebusiness.com.au>
> wrote:
>
> > It may be dangerous to assume that tasks which use the same
> > classpath can use the same classloader. I am already dealing with a
> > task which initialises a singleton.
>
> Well, I think it's not less dangerous to assume that tasks defined
> with different taskdefs have been loaded by different class loaders -
> and Singletons are evil anyway 8-)

Ok, Singletons are evil :-) I agree that this assumption is bad, especially
for Gump. This assumption isn't implied by the negative of the first
assumption, if you know what I mean. I shouldn't assume one task is loaded
using the same loader as another task, nor should I assume it will be
loaded in a different loader.

>
> > Therefore, I would prefer an approach where the build file writer is
> > explicit about which tasks should use the same loader.
>
> Maybe - I still wonder why they need to be loaded using the same class
> loader at all.

Well, hopefully Costin can give that motivation.

> You may remember that I proposed to load each tasklib
> using a classloader of its own for Ant2.

Yes, this is the way it should be.

> So we should analyze what
> Costin is trying to do here, to make sure it will be possible some way
> in Ant2.

Easy in Ant2, I believe. Just package the tasks in the same task lib.

>
> > <taskgroup>
> >    <classpath refid="blah"/>
> >    <taskdef name="foo" classname="com.foo.Foo"/>
> >    <taskdef name="bar" classname="com.foo.Bar"/>
> > </taskgroup>
>
> Similar to the part of the patch that I have committed, you just move
> the definitions from a property file to XML where it may be more
> obvious to the reader - works for me.

OK, I'll work on it.

Conor



Mime
View raw message