[jboss-dev-forums] [JBoss Microcontainer Development] - Re: New features in classloading

adrian@jboss.org do-not-reply at jboss.com
Thu Nov 19 10:46:45 EST 2009


No, actually there's an else missing :-)
In all three pieces routines.


  |       if (parentLoader instanceof ClassNotFoundHandler)
  |          parent = (ClassNotFoundHandler) parentLoader;
  | +      else
  | +      {
  |       ClassLoaderPolicy parentPolicy = getClassLoaderPolicy(parentLoader);
  |       if (parentPolicy != null)
  |          parent = parentPolicy;
  | +      }
  | 

If we know the parent implements Class*Handler then the second part is
redundant.

The second part is there for if you put a ClassLoaderToLoaderAdapter as the parent
rather than a Domain, like it does for web-apps. Then you've got to do a bit of a dance
to get the parent's ClassNotFoundHandler.

adapter -> BaseClassLoader -> ClassLoaderPolicy

In practice it will always return null into the parentPolicy for a ClassLoaderDomain
which is why I didn't spot it in the testing.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266586#4266586

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266586



More information about the jboss-dev-forums mailing list