标签:
<aop:config>
<!--配置切入点-->
<aop:pointcut id="pointcut" expression="execution(* com.itany.service.impl..*.*(..))"/>
<!--配置切面-->
<aop:aspect ref="testAspect">
<!--前置通知-->
<aop:before pointcut-ref="pointcut" method="beforeAdvice"/>
<!--后置最终通知-->
<aop:after pointcut="execution(* com.itany.service.impl..*.*(..))" method="afterFinallyAdvice"/>
<!--后置返回通知-->
<aop:after-returning pointcut="execution(* com.itany.service.impl.*.sayAfterReturning*(..))"
method="afterReturningAdvice"
arg-names="obj"
returning="obj"/>
<!--后置异常通知-->
<aop:after-throwing pointcut="execution(* com.itany.service.impl.*.sayAfterThrowing*(..))"
method="afterThrowingAdvice"
arg-names="excep"
throwing="excep"/>
<!--环绕通知 第一个参数必须是org.aspectj.lang.ProceedingJoinPoint类型-->
<aop:around pointcut="execution(* com.itany.service.impl.*.sayAround*(..))"
method="aroundAdvice"/>
</aop:aspect>
</aop:config>
说明:
标签:
原文地址:http://www.cnblogs.com/JavaTWW/p/5547820.html