Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Tracing a method call

Hi,
     Can we trace a method call through the codebase using pointcuts like this
 
  pointcut callStaticMethod ():
         call (* com.test.MyObject.callStaticMethod(..));
 
  before(): callStaticMethod() {
   System.out.println( thisJoinPointStaticPart.
                   getSourceLocation().getWithinType() );
   System.out.println( thisJoinPointStaticPart.
                   getSignature().getDeclaringTypeName() );
  }
 
 
Assume that there is a call line like this. method1 -> method2 -> method3 etc. We don't have annotations declared on these
methods.
 
If each method calls only one other method then we can trace the call line ? Is this possible ?
 
Thanks,
Mohan

Back to the top