1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <?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" 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-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">
<bean id="myMathCalculator" class="cn.justweb.impl.MyMathCalculator"></bean> <bean id="BValidateApsect" class="cn.justweb.utils.BValidateApsect"></bean> <bean id="logUtils" class="cn.justweb.utils.LogUtils"></bean> <aop:config> <aop:pointcut expression="execution(* cn.justweb.impl.*.*(..))" id="globalPoint"/> <aop:aspect ref="logUtils" order="1">
<aop:around method="myAround" pointcut-ref="mypoint"/> <aop:pointcut expression="execution(* cn.justweb.impl.*.*(..))" id="mypoint"/> <aop:before method="logStart" pointcut="execution(* cn.justweb.impl.*.*(..))"/> <aop:after-returning method="logReturn" pointcut-ref="mypoint" returning="result"/> <aop:after-throwing method="logException" pointcut-ref="mypoint" throwing="exception"/> <aop:after method="logEnd" pointcut-ref="mypoint"/> </aop:aspect> <aop:aspect ref="BValidateApsect" order="3"> <aop:before method="logStart" pointcut-ref="globalPoint"/> <aop:after-returning method="logReturn" pointcut-ref="globalPoint" returning="result"/> <aop:after-throwing method="logException" pointcut-ref="globalPoint" throwing="exception"/> <aop:after method="logEnd" pointcut-ref="globalPoint"/> </aop:aspect> </aop:config>
</beans>
|