ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Neward" <tnew...@javageeks.com>
Subject Re: Taskdef Classloader change (was RE: Custom Ant tasks and classpath issue)
Date Thu, 28 Feb 2002 12:46:15 GMT
You *could* always create your ClassLoaders to be off the main CL delegation
tree....

URLClassLoader ucl = new URLClassLoader(userURLs, null);

This would pull code from your user's URLs (an ant.task.path system
property?) and the bootclasspath, and nowhere else. This still satisfies all
the laws of ClassLoader type-safety--you're just ignoring the CLASSPATH and
Extension dirs (which you guys don't seem to like anyway) entirely.

Ted Neward
{.NET || Java} Course Author & Instructor, DevelopMentor
(http://www.develop.com)
http://www.javageeks.com/tneward

----- Original Message -----
From: "Vincent Massol" <vmassol@octo.com>
To: "'Ant Developers List'" <ant-dev@jakarta.apache.org>
Sent: Thursday, February 28, 2002 3:32 AM
Subject: RE: Taskdef Classloader change (was RE: Custom Ant tasks and
classpath issue)


>
>
> > -----Original Message-----
> > From: Stefan Bodewig [mailto:bodewig@apache.org]
> > Sent: 28 February 2002 11:13
> > To: ant-dev@jakarta.apache.org
> > Subject: Re: Taskdef Classloader change (was RE: Custom Ant tasks and
> > classpath issue)
> >
> > On Thu, 28 Feb 2002, Vincent Massol <vmassol@octo.com> wrote:
> >
> > > My understanding is that there is a hierarchy in CL : there is a
> > > parent and there are children CL.
> >
> > correct.
> >
> > > When a children CL is asked to load a class, it looks first if it
> > > can find it. If it cannot it delegates the load to its parent
> > > classloader. Up until the system classloader.
> >
> > No - the other way around, the child first asks the parent.  See the
> > API documentation of ClassLoader:
>
> that's right. I knew that at some point ... I don't know why I keep
> inverting this ... Ok, forget all my stupid questions. I now understand
> why it has to be like it is ... :-)
>
> Thanks
> -Vincent
>
> >
> > >>  The ClassLoader class uses a delegation model to search for
> > >>  classes and resources. Each instance of ClassLoader has an
> > >>  associated parent class loader. When called upon to find a class
> > >>  or resource, a ClassLoader instance will delegate the search for
> > >>  the class or resource to its parent class loader before attempting
> > >>  to find the class or resource itself.
> >
> > That way, if two loaders, which are children of the same class loader,
> > try to load a class that can be found by the parent class loader as
> > well as the child loaders will both get the class from the parent
> > class loader instead of two incompatible version loaded by the
> > children.
> >
> > Stefan
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:ant-dev-help@jakarta.apache.org>
> >
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message