Hi All,
I have an interface with two different implementations. I want to apply some advice to only one of those implementations. I'm using the RegexpMethodPointcutAdvisor. However if I set up the regexp so that it matches the implementation method's signature, the advice never gets called. And obviously setting up the regexp to match the interface method's signature is not the behaviour I want, as it will match the other implementation as well.
Is there any way I can make spring AOP match only a particular implementation of an interface method? I'm using spring 1.2RC1. Here's an excerpt of my config:
Cheers,Code:<bean id="connectionAdvice" class="connection.ConnectionInterceptor"> ... </bean> <bean id="connectionAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> <property name="advice"> <ref bean="connectionAdvice"/> </property> <property name="patterns"> <list> <!-- Regexp to match the interface method sig - works, but also matches unwanted implementations --> <value>service\.ConnectionMessageService\..*</value> <!-- Regexp to match the implementation method sig - doesn't work --> <value>service\.AxsResConnectionMessageService\..*</value> </list> </property> </bean>
Charles


Reply With Quote