Try annotating the advice you want to advise with a custom annotation and
use a pointcut expression like:

@NoAdvise
before() : adviceexecution() && cflow(withincode(@MyAnnotation * *.*(..)))
&& !clfow(withincode(@NoAdvise * *.*(..)) {

}
(There is a more elegant way of specifying this pointcut by extracting named
pointcuts, but this is the idea.)

This will make sure that you advise the proper pointcut, but you don't
infinitely recur through advice execution.


2009/5/6 Henrique Rebêlo <[email protected]>

> Hello everybody,
>
> Is there a way to advise (using another advice) a specific aspectj advice?
> For example, if we have an aspect "Aspect_T" with four advices (three afters
> and one before advice), which intercept join points in the type T, then is
> desirable to define an aspect "AdvisorAspect" that declares a before advice,
> in that, it inject extra code before the call/execution of the before advice
> declared into "Aspect_T".
>
> I also know that if we use adviceexecution() it works. However, it
> intercepts all advices (advice execution join points)... and I want to
> specify what advices (specific) must be advised!
>
> Henrique
>
>
> --
> Henrique Rebêlo, Centro de Informática, UFPE
> http://www.cin.ufpe.br/~hemr <http://www.cin.ufpe.br/%7Ehemr>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to