Cflow Versus Withincode
The following example illustrates the difference between cflow and withincode.
public class Hello { public void c() { System.out.println("C"); } public void b() { System.out.println("B"); c(); // <- pCflow() } public void a() { System.out.println("A"); b(); } public static void main(String[] args) { Hello test = new Hello(); test.c(); } }
public aspect HelloAspect { pointcut pWithincode() : call( * Hello.c() ) && withincode( * Hello.a() ); //advises nothing before() : pWithincode() { System.out.println("call-within"); } pointcut pCflow() : call( * Hello.c() ) && cflow( call(* Hello.a()) ); before() : pCflow() && !within(HelloAspect) { System.out.println("call-cflow"); } }
page_revision: 1, last_edited: 1180384193|%e %b %Y, %H:%M %Z (%O ago)





