Another performance/scalability “debate” due to Friendster migrating to PHP from Java Bruce Eckel Video: Talking about Java
Jul 09

Aspects as a deployable unit via aop.xml

AOP, Tech Add comments

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

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: Type in the word 'ajax'