[aosd-discuss] excluding a joinpoint shadow

Peter Kim chpkim at gmail.com
Mon Feb 26 15:55:01 EST 2007


Hi,

What is the best way to go about allowing a particular joinpoint
shadow (e.g. AST node) to be excluded from being advised?  For
example, if I have an aspect that advises call(* *.bar()), to exclude
calls to bar() within operation, I would modify the pointcut to "&&
!withincode(operation())".  However, I would like to allow the user to
exclude only the first call to bar() through some comment-annotation
mechanism as follows:

void operation()
{
   foo();
   bar();
   //@exclude
   bar();
}

I understand that this probably requires some modification to AspectJ
infastructure, but I'm not very familiar with the infrastructure and I
would like to know the fastest way to achieve this (though not too
dirty)...thank you so much!


-- 
Peter Kim
Ph.D. Candidate
Generative Programming Lab
Department of Electrical and Computer Engineering
University of Waterloo, Canada

http://swen.uwaterloo.ca/~chpkim
Tel: +1-519-635-2468
Office: DC2544



More information about the discuss mailing list