How to Debug ProxyFactoryBean Interceptor not firing
I'm trying to use the MethodInter开发者_如何学Cceptor and ProxyFactorBean to be able to produce audit information on a particular method.
I can see that the bean interceptedOpMethod is initialized, but it never gets called when originalOp is called. I don't see any errors in the log.
Is there some debugging capability within Spring to be able to track down why it isn't getting called?
<bean id="interceptedOpMethod" class="com.chunk.audit.CollectData" />
<bean id="originalOp" class="com.chunk.calculate.Stats" />
<bean id="interceptedOp" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target" ref="originalOp" />
<property name="interceptorNames">
<list>
<value>interceptedOpMethod</value>
</list>
</property>
</bean>
How are you instantiating com.chunk.calculate.Stats? If you create it via "new", then Spring never has the chance to inject the cut points into its instance methods.
精彩评论