<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="singer" class="com.spring.chapter01.aop.MusicSinger">
<constructor-arg value="zhang_zhl"/>
</bean>
<bean id="lister" class="com.spring.chapter01.aop.People">
<property name="singer" ref="singer"/>
</bean>
<aop:config>
<aop:aspect ref="lister">
<aop:pointcut id="listenerCut" expression="execution(* *.sing(..))"/>
<aop:before method="takeSeat" pointcut-ref="listenerCut"/>
<aop:before method="offPhone" pointcut-ref="listenerCut"/>
<aop:after-returning method="guzhang" pointcut-ref="listenerCut"/>
<aop:after-returning method="getMoney" pointcut-ref="listenerCut"/>
</aop:aspect>
</aop:config>
</beans>
用到的包: