<!-- 扫描-->
<centext:component-scan base-package="com.atguigu.spring.aop.annotation.xml"></centext:component-scan>
<!-- 基于xml的AOP实现-->
<aop:config>
<!-- 设置一个公共的切入点表达式-->
<aop:pointcut id="pointCut" expression="execution(* com.atguigu.spring.aop.annotation.xml.Impl.CalculatorImpl.* (..))"/>
<!-- 将IOC容器中的某个bean设置为切面-->
<aop:aspect ref="loggerAspect">
<!-- 前置通知-->
<aop:before method="beforeAdviceMethod" pointcut-ref="pointCut"></aop:before>
<!-- 后置通知,在目标对象的finally字句中执行 -->
<aop:after method="aferAdviceMethod" pointcut-ref="pointCut"></aop:after>
<!-- 返回通知 -->
<aop:after-returning method="afterReturningAdviceMethod" pointcut-ref="pointCut" returning="result"></aop:after-returning>
<!-- 异常通知-->
<aop:after-throwing method="afterThrowingAdviceMethod" pointcut-ref="pointCut" throwing="ex"></aop:after-throwing>
<!-- 环绕通知-->
<aop:around method="aroundAdviceMethod" pointcut-ref="pointCut"></aop:around>
</aop:aspect>
<!--
validateAspect:设置切面类
order设置优先级 -->
<aop:aspect ref="validateAspect" order="1">
<aop:before method="beforeMetod" pointcut-ref="pointCut"></aop:before>
</aop:aspect>
</aop:config>