> -----Original Message----- > From: Stefan Bodewig [mailto:[EMAIL PROTECTED] > Sent: 28 February 2002 11:13 > To: [EMAIL PROTECTED] > Subject: Re: Taskdef Classloader change (was RE: Custom Ant tasks and > classpath issue) > > On Thu, 28 Feb 2002, Vincent Massol <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
