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-deploye...
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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...