spring-common-aop.xml 1.26 KB
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
    default-autowire="byName">
	<bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/>
	
	<!-- ===================================================================== -->
	<!-- 记录业务方法的执行时间 -->
	<!-- ===================================================================== -->
	<bean id="serviceTimerAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
		<property name="advice" ref="methodProfilerInterceptor"/>
		<property name="patterns">
			<list>
				<value>com.taobao.sample.petstore.biz.store.service\..+</value>
				<value>com.taobao.sample.petstore.biz.user.service\..+</value>
			</list>
		</property>
	</bean>
	
	<bean id="methodProfilerInterceptor" class="com.taobao.sample.common.MethodProfilerInterceptor" >
		<property name="showArguments" value="true"/> <!-- 是否记录运行时方法的参数 -->
	</bean>
	
</beans>