[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Re: Reimplementing ClassPools for AS

adrian@jboss.org do-not-reply at jboss.com
Fri Dec 5 11:00:17 EST 2008


I've said this before, but I'll repeat it.

You shouldn't be trying to use the ClassLoaderSystem api for this.

The information you want is available in the ClassLoading/Modules api in the form
of what the parent domain is.

If its a sub-deployment with a Module then the parent is the classloader of the
parent deployment. (If it has no explicit parent domain specified.)
In all other cases it is the getDeterminedParentDomainName()

This last part is kind of an implicit rule created by the deployers
since only they understand what a subdeployment actually is. :-)

Like I said before, if we need to make something more explicit in the Module api 
or some helper class to make your life easier then we can do that.

The current "implicit" rule is here:
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractLevelClassLoaderSystemDeployer.java?revision=78007&view=markup

Although the first comment in the code is incomplete/wrong, I've corrected here.

  |       if (unit.isTopLevel() || module.getParentDomainName() != null)
  |       {
  |          // Top level or subdeployment with a parent domain, just create the classloader
  |          return classLoaderPolicyModule.registerClassLoaderPolicy(system);
  |       }
  |       else
  |       {
  |          // Subdeployment that wants a classloader
  |          ClassLoader parentClassLoader = unit.getParent().getClassLoader();
  |          return classLoaderPolicyModule.registerClassLoaderPolicy(system, parentClassLoader);
  | 

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

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



More information about the jboss-dev-forums mailing list