Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Use of aop.xml

Thanks a lot for your prompt response and sorry for the delay in sending the appreciation note. I was busy with my other priorities. Anyway I performed a simple LTW and things are working just great.

I am building a enterprise wide logging and auditing aspect module to keep the application code clean from any log4j or system.out.println. Here is my questions in regards to my aim,

- Should I define all point cuts in a single abstract Aspect and have different concrete aspect with defined point cut and package name to be included? Or Should I build each point cut as a separate abstract Aspect? Is there a preference in one way or other?

- I can implement the available join points like method entry, exception handling etc., but how do I implement a particular object value logging functionality. Lets say if the client wants to print the hashmap value deep inside some methods, how do we do this?

- Is there any performance bench mark study with LTW?

- How do I exclude a point cut completely in LTW (concrete aspect definition in aop.xml)

- What is the use of weaver tag definition (exclude and include attributes) in aop.xml if we can filter everything thru concrete-aspect?

Thanks and appreciate your time and help,
- Sudharsan.



On Wed, Apr 1, 2009 at 1:13 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
Hi,

Did you see the documentation here?

http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html

The solution for you would appear to be leave the aspects partially abstract in the traceAspect then concretize the pointcuts in the XML

abstract aspect AbstractTraceAspect {
  abstract pointcut scopeForPointcutOne();
  pointcut traceOne(): execution(* *(..)) && scopeForPointcutOne();

  abstract pointcut scopeForPointcutTwo();
  pointcut traceTwo(): execution(* *(..)) && scopeForPointcutTwo();
}

  <aspectj>
<aspects>
<concrete-aspect name="Concrete" extends="mypack.AbstractTraceAspect">
<pointcut name="scopeForPointcutOne" _expression_="within(com.util.services..*)"/>
<pointcut name="scopeForPointcutTwo" _expression_="within(com.all.services..*)"/>
</concrete-aspect>
<aspects>
</aspectj>

Andy.

2009/4/1 Sudhar <sudhar.suba@xxxxxxxxx>
I am trying to use AspectJ as the standard framework for logging and tracing for my J2EE application. After going thru some of the tutorials and AspectJ project side, I have identified about 15 pointcust and implemented them in a single aspect class.
But I want these pointcuts to be consumed by the client based on their package or class name pattern and found out that aop.xml offer this load time weaving functionality. But I couldn't succeed in getting it work and also I don't see much documentation on how to get this working.
This is what I have
  Aspect called TraceAspect contains 15 pointcuts with log4J api to log those point cuts execution.

Need to have a configurable xml file to selectively specify pointcut to specific class or package pattern.
Ii.e)  pointcut A should be applied to com.util.services.*
       pointcut B should be applied to com.all.services.*
etc..

Thanks and greatly appreciate time and effort in answering this,
- Sudharsan.




_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top