在一个applicationContext.xml文件中的代码
<arid:define-beans package="kr.ac.bsac.is" pattern="*..service.*Service || *..dao.*DAO" autowire="byName"/> <aop:config>
        <aop:pointcut id="serviceOperation" expression="execution(* kr.ac.gdc.is..service.*Service.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/>
</aop:config>
不知道是做什么的

解决方案 »

  1.   

    还有这段代码
    <tx:advice id="txAdvice" transaction-manager="txManager">
            <tx:attributes>
                    <tx:method name="get*" read-only="true"/>
                    <tx:method name="find*" read-only="true"/>
                    <tx:method name="view*" read-only="true"/>
                    <tx:method name="save*" propagation="REQUIRED"/>
                    <tx:method name="*" propagation="REQUIRED"/>
            </tx:attributes>
    </tx:advice>
      

  2.   


    Spring 2.0的新配置: 
    如果如果service没有基于接口,使用cgilib来实现AOP<aop:config proxy-target-class="true"> 
        <aop:advisor pointcut="execution(* com.xyz.service..*Manager.*(..))" advice-ref="txAdvice"/> 
        <aop:advisor pointcut="execution(* com.xyz.service..*Manager.save(..))" advice-ref="fooAdvice"/> 
    </aop:config>
    <tx:advice id="txAdvice" transaction-manager="transactionManager"> 
        <tx:attributes> 
            <tx:method name="get*" read-only="true"/> 
            <tx:method name="find*" read-only="true"/> 
            <tx:method name="*" /> 
       </tx:attributes> 
    </tx:advice> 
    execution(* *..BookManager.save(..))的解读: 
    第一颗* 代表ret-type-pattern 返回值可任意, 
    *..BookManager 代表任意Pacakge里的BookManager类。 
    如果写成com.xyz.service.* 则代表com.xyz.service下的任意类 
    com.xyz.service..* com.xyz.service则代表com.xyz.service及其子package下的任意类 
    save代表save方法,也可以写save* 代表saveBook()等方法  <arid:define-beans package="kr.ac.bsac.is" pattern="*..service.*Service || *..dao.*DAO" autowire="byName"/>
    不知道这个什么API
      

  3.   

    AOP声明事务配置,不过那个arid确实没看过
      

  4.   

    参见这篇文章:http://chris-richardson.blog-city.com/simpler_xml_configuration_files_for_spring_dependency_inject.htm