ITeye博客

A-O-P配置事务

kkllmey · 2008-09-26 15:44 · Spring · Markdown

<?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 -->
 <bean id="loggerBean" class="com.aptech.aop.LoggerBean" />
 <!-- 配置目标对象 -->
 <bean id="aopBean" class="com.aptech.aop.AOPBean"/>
 <aop:config>
  <!-- 配置切入点 -->
  <aop:pointcut id="loggerCalls" expression="execution(* com.aptech.aop.AOPBean.display(..))" />
  <!-- 配置切面 -->
  <aop:aspect id="logAspect" ref="loggerBean">
   <!-- 配置环绕通知 -->
   <aop:around pointcut-ref="loggerCalls" method="aroundLogCalls" />
  </aop:aspect>
 </aop:config>
</beans>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。