[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Generated Classes not found if they do not match any of
kabir.khan@jboss.com
do-not-reply at jboss.com
Mon Feb 2 14:31:03 EST 2009
"adrian at jboss.org" wrote :
| You haven't answered why it is defined against the user classloader?
| See my point about classloader leaks.
|
It is defined against the user classloader since as far as I can tell:
-We cannot use the system classloader. The proxies use interfaces from the aop classloader (org.jboss.aop.proxy.container.AspectManaged and org.jboss.aop.proxy.container.Delegate) which are not visible from the system classloader.
-We cannot use the aop classloader. The proxies might have interfaces introduced by the deployment, whose classloader might be in a child domain of the aop classloader's domain. Those interfaces would not be visible from the aop classloader.
At the moment we are caching the generated proxies by deployment classloader. The classloader is the key into a WeakHashMap. If deploymentA wants to create a proxy for ArrayList with no interface introductions, we generate the proxy class using deploymentA's classloader. If deploymentB wants to create a similar proxy for ArrayList, we generate the proxy class using deploymentB's classloader. Subsequent attempts to get a plain ArrayList proxy from deploymentA's classloader will use deploymentA's cached class, and deploymentB will use deploymentB's cached class.
Doesn't your point about classloader leaks hold for any deployment?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206335#4206335
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206335
More information about the jboss-dev-forums
mailing list