首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

acegi TransactionInterceptor碰到spring2.x

2012-11-21 
acegi TransactionInterceptor遇到spring2.x一直使用spring2.x都没有问题,所有service都通过AOP注入。现在

acegi TransactionInterceptor遇到spring2.x
一直使用spring2.x都没有问题,所有service都通过AOP注入。
现在用acegi的ACL,却发现原来的AOP影响而不能使用。以下是我的AOP
<!-- Transactional advice --> 
<tx:advice id="txAdvice" transaction-manager="transactionManager"> 
<tx:attributes> 
<!-- methods starting with 'save', 'update' or 'remove' use the default transaction settings --> 
<tx:method name="save*"/> 
<tx:method name="delete*"/>
<tx:method name="merge*"/>
<tx:method name="remove*"/> 

<!-- other methods are set to read only --> 
<tx:method name="*" read-only="true"/>
</tx:attributes> 
</tx:advice>

<aop:config proxy-target-advice-ref="txAdvice"/>
</aop:config>

而TransactionInterceptor是这么定义的:
<bean id="articleService" value="cn.biaoming.service.ArticleService"/>
      <property name="target"><ref local="articleServiceTager"/></property>
      <property name="interceptorNames">
         <list>
            <idref local="articleServiceSecurity"/>
         </list>
      </property>
   </bean>
  
  
   
    <bean id="articleServiceSecurity" ref="articleServiceSecurity">

    <aop:before
        pointcut="execution(* cn.biaoming.service.ArticleService.*(..))"
        method="a_method_of_articleServiceSecurity"/>

  </aop:aspect>

</aop:config>

<bean id="articleServiceTager" />

以上代码不保证没错~~~</aop:config> expression="execution(* cn.biaoming.service.ArticleService.*(..))" />
<aop:advisor pointcut-ref="idempotentOperation1"
advice-ref="articleServiceSecurity" />
   </aop:config> 11 楼 imp9527 2008-03-29     一个类只能被代理一次 acegi 配置你已经代理一次了 或者是你在事物代理的时候
     SPRING在做代理的时候 已经指出 代理后的类是 FINAL 了·
         用SPRING2.0的方式去配置代理 与AOP 应该可以解决问题

热点排行