Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] 1 pointcut, 2 around advice, Each advice calls code which is woven

Hi again,

I am currently using the AJDT 1.6.3 plugin on Eclipse 1.3.4.

I have an aj project containing 3 aspects and two around() advices for the same pointcut. 2 concrete aspects derive from an abstract aspect which defines this common pointcut.
Each concrete aspect implements a different concern with an around() advice.
The code in each around advice calls code which is woven by these very aspects.
Both advices call proceed() and return an Object.

My problem is that depending on the precedence order, only one of the two advices manifests itself (it's the highest order one).

For example, in the abstract aspect I declare the common pointcut:
protected pointcut myPointcut() : execution(* InterfaceA+.*(..)) && !cflow(adviceexecution());

In the first aspect I advise by calling code which implements InterfaceA:
Object around() : myPointcut() {
// Code which executes methods in InterfaceA (which get woven by this very advice)
Object result = proceed();
// More code which executes methods in InterfaceA (which get woven by this very advice)
return result;
}

The second aspect is more or less the same (it also calls woven code).
I suspect the !cflow(adviceexecution) - while preventing recursion - also prevents the other lower order aspect from running.
Does anyone have a suggestion on how to best rewrite myPointcut?

Thanks so much!
Kevin


Back to the top