现在的位置: 首页 > 综合 > 正文

ITCAST视频-Spring学习笔记(使用Spring配置文件实现AOP)

2012年04月05日 ⁄ 综合 ⁄ 共 611字 ⁄ 字号 评论关闭
 

感谢ITCAST发布的免费视频

 

基于XML配置方式声明切面

<bean id=”orderservice” class=”cn.service.OrderServiceBean” />

<bean id=”log” class=”cn.service.LogPrint” />

<aop:config>

       <aop:aspect id=”myaop” ref=”log”>

       <aop:pointcut id=”mycut” expression=”execution(* cn.service..*.*(..))”/>

       <aop:before pointcut-ref=”mycut” method=”doAccessCheck” />

       <aop:after-returning pointcut-ref=”mycut” method=”doReturnCheck” />

       <aop:after-throwing pointcut-ref=”mycut” method=”doExceptionAction” />

       <aop:after pointcut-ref=”mycut” method=”doReleaseAction” />

       <aop:around pointcut-ref=”mycut” method=”doBasicProfiling” />

</aop:aspect>

</aop:config>

抱歉!评论已关闭.