标签:config only methods int www version tar att ref
<?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:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="find*" read-only="true" /> <tx:method name="query*" read-only="true" /> <tx:method name="get*" read-only="true" /> <tx:method name="*" /> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut expression="execution(* org.mx..dao.I*Dao.*(..))" id="daoMethods" /> <aop:pointcut expression="execution(* org.mx..task.I*Task.*(..))" id="taskMethods" /> <aop:pointcut expression="execution(* com.business..I*Business.*(..))" id="businessMethods" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="daoMethods" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="taskMethods" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="businessMethods" /> <aop:aspect id="LogAspect" ref="LogAspectBean"> <aop:pointcut expression="execution(* org.mx..task.I*Task.*(..))" id="logsPointCut" /> <aop:pointcut expression="execution(* com.business.I*Business.*(..))" id="logsPointCutBusiness" /> <aop:around pointcut-ref="logsPointCut" method="businessLogAround" /> <aop:around pointcut-ref="logsPointCutBusiness" method="businessLogAround" /> </aop:aspect> </aop:config> </beans>
标签:config only methods int www version tar att ref
原文地址:https://www.cnblogs.com/Alwaysbecoding/p/12393864.html