Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] How to get the caller's details for a execution pointcut?

You can only get the callers information if you advise the call-site.  If you advise the execution-site then it is too late (although you *could* 'manually' inspect the stack trace at that point to determine the caller).

cheers,
Andy.

2008/7/29 PATIL Arvind <Arvind_PATIL@xxxxxxxxxxxxxxxxx>

Hi,

I have defined a pointcut of type execution for a method test() in a class ABC.

And I have defined a before-advice which is supposed to show the file name and line number of the caller programs which invoke this method ABC.test().

 

This is the advice code.

 

   static private void printParameters(JoinPoint jp) {

                   System.out.println("Source: " +jp.getSourceLocation());

}

 

However, this always displays the callee method details.

How can I get the caller's details for a execution pointcut?

 

thanks,

arvind

-------------------------------------------------------------------------------------------------------------------------------------------------------------

 


_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev



Back to the top