VERY interesting questions...
Would be great to get some feedback here! Please. :-)
JBoss AOP and AspectJ probably will not work with one another. I have not tried and would be interested if somebody did.
Spring AOP is just dynamic proxies and not bytecode weaving so there should be no problems. JBoss AOP also has a dynamic proxy only framework, but we have not documented it until we finish integrating it with JBoss Microcontainer.
Well Bill, :-) I just spent few hours doing that work!
I am excited and I am the master ;)
Here are the results:
AspectJ CAN BE INTEGRATED together with JBossAOP.
If no problems discovered in future then one could have the best of 2 AOP worlds.
Will reference AspectJ as AJ and JBossAOP as JBAOP below
Compilation process are easy 2 steps: [ajc] task first, then [aopc] task (using Ant).
What did work for me (anything else not tried yet):
environment: all using Java5, pre and post compilation. Not dynamic style.
advice on the same pointcut: two different AOP frameworks' advice on the same method execution pointcuts worked! One specified and implemented with AJ (AJAspect.aj) and another specified (jboss-aop.xml) and implemented with JBAOP (JBossAOPAspect.java)
I cannot see the use case for that (for now :) ), but the bytecode manipulation just worked. AspectJ bytecode processing (around advice) did almost none of processing to the method being adviced -- just a call to custom AJ method. Presumably that's why [aopc] could work on the processed bytecode :)
Of course the method being adviced where specified using annotations:
@pat.bo @pat.transaction->(..) -- in case of JBAOP execution(@pat.transaction * (@pat.bo *).*(..)); -- in case of AJ
Introductions: mixins and simple interface introduction worked with JBAOP when at the same time I used AJ "inter-type" declarations (introductions).
So, basically I achieved binary introductions with JBAOP somehow ;-D.
AJ's declare errors: AJ's pointcut expression language can be used to declare warnings and errors. Basically this doesn't change the bytecode, so it should work anyhow.
More to discover....
I'll blog about that around Wednesday and also will provide sources for that.