"kabir.khan(a)jboss.com" wrote : "kabir.khan(a)jboss.com" wrote :
| | When we want to USE a proxy from a different classloader, we need to be able to
load the proxy class. Proxies have unique names (static counter maintained by proxy
factory across all loaders). In the example I gave deploymentA's proxy for ArrayList
will be AOPProxy$1, and deploymentB's proxy for ArrayList will be AOPProxy$2 (both in
the default package)
| |
|
| So I want to be able to look up "AOPProxy$1" from deploymentB, and
"AOPProxy$2" from deploymentA. That is what is not working at the moment.
Yes that is because the package is not exported, as discussed above.
anonymous wrote :
| It uses the proxied class's package if the classname does not start with
"java" or "sun". For example:
| -a proxy for java.util.ArrayList is AOPProxy$1 (currently in default package)
| -a proxy for org.jboss.some.Thing is org.jboss.some.AOPProxy$2
|
| Only JDK classes should not be in the package of the proxied class, and we need to
find another home for these. Deployment classes are causing no problem.
|
| In short, we always use the classloader of the deployment rather than the classloader
of the class we are proxying. This happens whether it is a system class (ArrayList) or
something else. There might be interface introductions etc. that need to be able to see
classes from the deployment classloader, so that is the easiest way.
|
My concern was that you had one class for all deployments defined against the
"first" classloader, which could later get redeployed and thus cause that
classloader to leak.
It doesn't sound like you are doing that. The other deployments will only
use those classes from other deployments if they are directed to do so, e.g. by passing
an object that uses that class.
OFF TOPIC:
But it does sound like you are generating instrumented classes for things like
java.util.ArrayList in every deployment which could be minimized if they were shared
in the AOP classloader. I get your point about introductions, but isn't that an edge
case?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206626#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...