PDA

View Full Version : access to target object of the methodInvocation



samema
Sep 3rd, 2004, 10:05 AM
Hi

I have a name match method interceptor for a class TestClass for the method TestMethodOne.

In the interceptor based on a decision, i would like to call TestMethodTwo of the same class.

But i don't have access to the target object of the methodInvocation inside the invoke().

Is this the right way to approach the issue? was it the intentional to not allow access to the Target object inside the invocation?

thanks

Rod Johnson
Sep 3rd, 2004, 10:26 AM
You do have access to the target. Use
MethodInvocation.getThis() which is inherited from Joinpoint.

samema
Sep 3rd, 2004, 10:42 AM
Thanks..it was my mistake ...i didn't notice it