Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Caller joinpoint

Hi,
 
Is there a way to capture the caller joinpoint (the joinpoint that contains the caller method)?
There is a small example:
 
public class A {
  void m1() {...}
  void m2() { m1(); }
  void m3() { m2(); };
}
 
public class B {
  void m4() { A.m3(); }
}
 
public aspect TraceCaller {
  pointcut pc(JoinPoint caller) : cflow(call(* *.*(..)) && this(caller)); ????
}
 
expected result:
m1 caller = call(void A.m2())
m2 caller = call(void A.m3())
m3 caller = call(void B.m4())
 
 
Thanks,
 
André

Back to the top