ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: Taskdef Classloader change (was RE: Custom Ant tasks and classpath issue)
Date Thu, 28 Feb 2002 11:32:43 GMT


> -----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>


Mime
View raw message