<?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:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
	xmlns:cache="http://www.springframework.org/schema/cache"
	xmlns:tx="http://www.springframework.org/schema/tx"
	default-autowire="byName"
	default-lazy-init="true"
    xmlns:task="http://www.springframework.org/schema/task"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:ehcache-spring="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:websocket="http://www.springframework.org/schema/websocket" 
	xsi:schemaLocation=
		"http://www.springframework.org/schema/aop
		http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
		http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
		http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
		http://www.springframework.org/schema/cache
		http://www.springframework.org/schema/cache/spring-cache-4.1.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
		http://www.springframework.org/schema/task  
		http://www.springframework.org/schema/task/spring-task-3.1.xsd  
		http://www.springframework.org/schema/websocket 
		http://www.springframework.org/schema/websocket/spring-websocket.xsd
		http://www.springframework.org/schema/context
		http://www.springframework.org/schema/context/spring-context-3.2.xsd">
		
	<!-- 配置自动扫描的包:不扫描控制器和异常处理 -->
	<context:component-scan base-package="com.iamberry">
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
		<context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice" />
	</context:component-scan>
	
	<!-- 使用CGLIB动态代理 -->
    <aop:aspectj-autoproxy proxy-target-class="true"/>

	<!-- 数据源配置 -->
	<import resource="classpath:iamberry-wechat-service-datasource.xml"/>
    
    <!-- 配置springContextHolder -->
    <bean class="com.iamberry.zk.SpringContextHolder" lazy-init="false" />
    
	<!-- 平台LOG配置,立即加载，拒绝懒加载 -->
	<bean id="logger" class="com.iamberry.app.tool.log.RatFWLogger" scope="singleton" autowire="byName" lazy-init="false">
		<property name="appId" value="iamberry" />
	</bean>
	
	<!-- 加载静态资源 -->
	<bean id="loadResultInfo" class="com.iamberry.wechat.tools.loadResultUtil" lazy-init="false"></bean>
    
	<!-- 开启注解启动定时器 -->
    <!--<task:annotation-driven/>-->

	<!-- spring监控 -->
	<bean id="druid-stat-interceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor">
	</bean>
	<bean id="druid-stat-pointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">
		<property name="patterns">
			<list>
				<value>com.iamberry.wechat.*</value>
			</list>
		</property>
	</bean>
	<aop:config proxy-target-class="true">
		<aop:advisor advice-ref="druid-stat-interceptor" pointcut-ref="druid-stat-pointcut" />
	</aop:config>
</beans>
