[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - VFSClassLoaderScopingPolicy needs updating
adrian@jboss.org
do-not-reply at jboss.com
Tue Mar 25 15:06:04 EDT 2008
I'm trying to figure out how to fix the VFSClassLoaderScopingPolicy
with the new rules for WAR classloading deployments.
The way it works now is that when a war gets deployed, there's a seperate
deployer that decides whether WARs (subdeployments) should be scoped.
They are by default.
If this is the case, then the war subdeployment will have its own Module
and its own Domain.
You shouldn't need any hacks anymore for "isWar" or "isWebCL"
or looking at the top level classloader. All you need to know is whether
Module.determineDomain() is not the default domain (therefore it is scoped)
and Module.determineParentDomain() to know what it is scoped against.
Of course most subdeployments other than wars will use the top level
classloader of the whole deployment.
I was trying to figure out what needs changing, but I got lost. :-)
OFF TOPIC
One thing I did find is this code in JBoss5ClassPoolFactory
| //It is scoped
| ClassLoaderSystem sys = ClassLoaderSystem.getInstance();
|
| ClassLoaderDomain domain = sys.getDomain(module.getDeterminedDomainName());
| boolean parentFirst = module.isJ2seClassLoadingCompliance();
|
That isn't necessarily correct. It's configurable in bootstrap-beans.xml
what the ClassLoaderSystem is.
It look's like the only reason you do this
is to get the domain, because you're still doing that horrible code
that tries to determine scoping rules based on whether the resource
visibile to the domain is the same as the resource from the classloader.
Like I said before, this isn't going to work if the classloader doesn't export the class.
Probably what you really want is something like the new JMX operation on the domain
findClassLoaderForClass()
except starting from the classloader you're handling rather than the domain?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138806#4138806
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138806
More information about the jboss-dev-forums
mailing list