[PRL] aspects to eliminate aspects
Pengcheng Wu
wupc at ccs.neu.edu
Wed May 18 12:12:52 EDT 2005
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!");
}
}
Basically, you capture all advice execution in aspects other than the
CheckerAspect and if the method calls those advice are operating on are
from the class you are checking with, then raise an error.
I am not sure how a static checker can be easily implemented. But I feel
that with my language extension proposal called Statically Executable
Advice (AOSD'2003), it won't be too hard either.
--Pengcheng
More information about the PRL
mailing list