[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - AOP asintegration WITHOUT the integration :-)
adrian@jboss.org
do-not-reply at jboss.com
Tue Aug 7 23:10:43 EDT 2007
Related to these threads:
New classloader tests - http://www.jboss.com/index.html?module=bb&op=viewtopic&t=114427
Refactoring ASIntegration for new classloader -
[url]
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112771[/url]
AOP Scoping is WRONG!
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112736
I think I've found a way to make this work without having to any integration.
The basic problem is the one I found with the TCL usage.
When this is fixed (and some other things), we don't need any integration code.
The new tests I wrote now all work with the following two changes:
1) In JoinPointGenerator I now always use the classloader of the pool
where the advice lives, not the TCL.
2) I've added a new option "pushClassLoader" to the AspectManager
which says that when generating advices it should be done under the
classloader of the **Advised** class
Obviously these changes are incomplete:
a) Part (2) above should be using the classloader of the **Advice** class
b) I'm only doing (2) for PER_VM and PER_CLASS since that's all I've tested so far
c) There are other places besides the Advisor that generate advices
d) There are a number of other places that use the TCL that need fixing
in a similar way.
There's one other fix that needs doing which is in (I haven't made this change)
AspectManager.findClassPool()
The use of Translatable is obsolete. It should really be doing something like:
| if (cl == null)
| cl = ClassLoader.getSystemClassLoader(); // Using SecurityActions;
| return registerClassLoader(cl);
|
For now, I've made RealClassLoader (which is what both the new and old
classloaders extend) implement Translatable.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071811#4071811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071811
More information about the jboss-dev-forums
mailing list