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

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



Back to the top