Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Can we advise a specific advice in aspectj?

Hi Andrew,

 Thanks for replying.

Henrique

On Thu, May 7, 2009 at 12:30 AM, Andrew Eisenberg <andrew@xxxxxxxxxxxx> wrote:
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 <hemr@xxxxxxxxxxx>
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

_______________________________________________
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




--
Henrique Rebêlo, Centro de Informática, UFPE
http://www.cin.ufpe.br/~hemr

Back to the top