Hello all, I'm new to AOP and I've followed several of the examples and read the docs, but I may not be grasping something fully. Is there a way to inject the caller of a pointcut method into the aspect? For example suppose ClassA.methodA calls ClassB.methodB and methodB is defined as a pointcut (in which case the InterceptorA.doSomething method is defined). Can ClassA (in my understanding, the "caller") get injected into the aspect so I can interrogate some portions or pull attributes out of it in the advice?
FWIW, I'm using the schema approach for context definition and I would have something like this currently:
Would changing it to this inject the calling class into the advice?
<aop:pointcut id="pointcutId" expression="execution(* ClassB.methodB(..))"/>
If so, would it inject the instance of the bean that triggered the pointcut?
<aop:pointcut id="pointcutId" expression="execution(* ClassB.methodB(..)) and bean(ClassA)"/>
Thanks in advance!