spring aop ioc配置文件

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<bean id="testBean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>wang.joyon.test.T</value>
</property>
<property name="target">
<ref local="test" />
</property>
<property name="interceptorNames">
  <list>
  <value>loggingBeforeAdvicor</value>
  <value>loggingAfterAdvicor</value>
 
  </list>
</property>
</bean>

<bean id="test" class="wang.joyon.test.Test1" />



<bean id="loggingBeforeAdvicor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref local="loggingBeforeAdvice"></ref>
</property>
<property name="pattern">
<value>.*</value>
</property>
</bean>

<bean id="loggingAfterAdvicor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref local="loggingAfterAdvice"></ref>
</property>
<property name="pattern">
<value>.*1</value>
</property>
</bean>

<bean id="loggingBeforeAdvice" class="wang.joyon.test.LoggingBeforeAdvice"></bean>
<bean id="loggingAfterAdvice" class="wang.joyon.test.LoggingAfterAdvice"></bean>


</beans>

猜你喜欢

转载自promisepk.iteye.com/blog/2319752