Spring Study[8]

Regular expression pointcuts:
when you are using the RegexpMethodPointcut, you need to include the Jakarta Commons ORO 3 library in your application.

<beans>
<bean id="maidServiceTarget"
class="com.springinaction.chapter03.cleaning.MaidService"/>
<bean id="queryInterceptor" class="com.springinaction.
chapter03.cleaning.QueryInterceptor"/>
<bean id="queryPointcutAdvisor"
class="org.springframework.aop.support.RegExpPointcutAdvisor">
<property name="pattern">
<value>.*get.+By.+</value>
</property>
<property name="advice">
<ref bean="queryInterceptor"/>
</property>
</bean>

<bean id="maidService"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>com.springinaction.chapter03.
cleaning.MaidService</value>
</property>
<property name="interceptorNames">
<list>
<value>queryPointcutAdvisor</value>
</list>
</property>
<property name="target">
<value ref="maidServiceTarget">
</property>
</bean>
</beans>

你可能感兴趣的:(spring)