I'm having this problem as well. I want to intercept calls on a particular implementation of a method that is defined in an interface. However unless I specify both the interface and the implementing class in the pointcut regexp. It doesn't work. Is this intentional?
Here is the my basic configuration:
Code:
<bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" />
<bean id="connectionAdvice" class="foo.ConnectionAdvice"/>
<bean id="connectionAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref bean="connectionAdvice" />
</property>
<property name="patterns">
<list>
<!-- see details below -->
...
</list>
</property>
</bean>
Now lets say I have an interface "foo.Something" that defines a method "doSomething". Now I implement "foo.SomethingImpl which implements this interface. I want to intercept calls to SomethingImpl.doSomething. Specifying the implementation class method in the RegexpMethodPointcutAdvisor patterns does not work:
Code:
<value>foo\.SomethingImpl\.doSomething</value>
Neither does specifying the interface class method:
Code:
<value>foo\.Something\.doSomething</value>
However if I specify both, it works:
Code:
<value>foo\.Something\.doSomething</value>
<value>foo\.SomethingImpl\.doSomething</value>
Am I missing something here?