[PRL] aspects to eliminate aspects
Pengcheng Wu
wupc at ccs.neu.edu
Wed May 18 12:48:29 EDT 2005
On Wed, 18 May 2005, Pengcheng Wu wrote:
>
> I bet you wanted the answers to both of the questions to be 'no'.
>
> On Wed, 18 May 2005, Matthias Felleisen wrote:
>
> > Question 1: Is it possible to write an aspect that monitors a class to
> > discover the intervention of _other_ aspects?
>
> I think a dynamic checker is easy to implement. You can have something
> like:
>
> aspect CheckerAspect {
> pointcut adviceinanotheraspects(): adviceexecution() && within(!CheckerAspect); //or you can always enumerate all
> other aspects
> before(): adviceinanotheraspects() {
> if(thisJoinPoint.getThis().getClass() is the class you want to check with)
> error("A undesired intervention detected!");
> }
> }
Sorry, this is close but it doesn't work exactly as I was expecting. The
thisJoinPoint here will capture the advice execution itself, instead of the method it is
advicing. Seems the latter is more useful. Using cflow won't help much
either.
--Pengcheng
More information about the PRL
mailing list