Hi, I want to apply an advisor to multiple beans at the same time. I tried BeanNameAutoProxyCreator as follows:
<bean id="myAutoProxyCreator"
class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
<property name="beanNames">
<value>*Manager</value>
</property>
<property name="interceptorNames">
<list>
<idref bean="myAdvisor"/>
</list>
</property>
</bean>
<bean id="advisor" class="org.springframework.aop.support.DefaultPoin tcutAdvisor">
<property name="advice">
<ref local="myInterceptor"/>
</property>
<property name="pointcut">
<bean class="org.springframework.aop.support.JdkRegexpMe thodPointcut">
<property name="pattern">
<value>^org.example.service.[a-zA-Z]{1}(\\w)*Manager.(\\w)*</value>
</property>
</bean>
</property>
</bean>
The reason why I am using JdkRegexpMethodPointcut is because there are many other Manager objects that are from the Spring and other packages. So I want to add some restriction.
The problem is that none of my service methods get called. Am I doing something wrong? Is the above declaration correct?
Thanks, Pete


Reply With Quote