I really like the new feature in AspectWerkz 1.0.
They have a notion of an AOP Container in that you can deploy aspects and aspect libraries as components.
You just need to setup an aop.xml such as:
<!DOCTYPE aspectwerkz PUBLIC
“-//AspectWerkz//DTD//EN”
“http://aspectwerkz.codehaus.org/dtd/aspectwerkz.dtd”><aspectwerkz>
<system id=”webapp”>
<aspect class=”demoAOP.DemoAspect”>
<pointcut name=”allPublic” expression=”execution(public * *..*.*(..))”/>
<advice name=”trace” type=”around” bind-to=”allPublic”/>
</aspect>
</system>
</aspectwerkz>
The aspects only affect the area that they should via:
Note that if an Aspect is deployed within an application, the pointcut it defines will be limited by the class loader isolation principle. Even if the pointcut assumes to match all method in all classes, it will only “see” all methods in classes loaded by this classlaoder and the child classloader.
Cool stuff. It would be fun to have Spring grok this aop.xml file too :)
Read Alex’s tutorial: How to integrate Aspects in J2EE apps with aop.xml