<!-- 观众(通知) -->
<bean id="audience" class="aspectj.Audience"/>
<!-- 通过配置元素 将 pojo变成一个切面类 -->
<aop:config>
<aop:aspect ref="audience">
<!-- 引入通知 ,types-matching:指定给哪些类增加新的属性与方法
implement-interface: 新接口
default-impl:新接口的默认实现-->
<aop:declare-parents types-matching="aspectj.Singer"
implement-interface="aspectj.IHeight"
default-impl="aspectj.HeightImpl"/>
<!-- 定义切入点, (重用) -->
<aop:pointcut id="audiencePointcut" expression="execution (* aspectj.Performer.*(..))"/>
<!-- 各种切入 -->
<aop:before method="takeSeats" pointcut-ref="audiencePointcut"/>
<aop:before method="turnOffCellPhone" pointcut-ref="audiencePointcut"/>
<aop:after-throwing method="demandRefund" pointcut-ref="audiencePointcut" throwing="e"/>
<aop:after-returning method="applaud" pointcut-ref="audiencePointcut" returning="ret"/>
<aop:after method="goHome" pointcut-ref="audiencePointcut"/>
<aop:around method="doWatch" pointcut-ref="audiencePointcut"/>
</aop:aspect>
</aop:config>