-
1. Intercept an method call within a specific statement
kabirkhan Jan 11, 2011 4:12 PM (in response to rhp)You could use cflow although that is very slow since it would need to create an exception to inspect the stack when you call getAddress() or getStree()
-
2. Re: Intercept an method call within a specific statement
rhp Jan 11, 2011 7:39 PM (in response to kabirkhan)Kabir Khan
Your suggestion is to use cflow intercepting all join points in the control flow of all methods. Inside the advice, trigger an exception (and catch) and examine the stack. Correct?
But in the stack of the exception will dont show any reference to the method getPerson(), because getAddress() and getStreet() are called outside.Thanks,
Rui
-
3. Re: Intercept an method call within a specific statement
flavia.rainone Jan 26, 2011 3:49 PM (in response to rhp)In that case, there is no pointcut syntax construct to support what you're trying to do.
-
4. Intercept an method call within a specific statement
rhp Feb 26, 2011 7:29 AM (in response to flavia.rainone)I've also come to this conclusion.
So, I developed a preprocessor that identifies the jointpoints and applies the Aspect code. In my project, this preprocessor works like a static weaver.
In a next phase, would be interesting develope a parser capable of support a pointcut syntax like "withincodestatement() "