<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
						http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
						http://www.springframework.org/schema/context 
						http://www.springframework.org/schema/context/spring-context-3.0.xsd 
						http://www.springframework.org/schema/aop 
						http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
						http://www.springframework.org/schema/tx 
						http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
						http://www.springframework.org/schema/mvc   
      					http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <context:annotation-config/>
    <!-- 定义扫描根路径为leot.test，不使用默认的扫描方式 -->
    <context:component-scan base-package="co.dc" use-default-filters="false">
        <!-- 扫描符合@Service @Repository的类 -->
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Service"/>
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Component"/>
    </context:component-scan>


    <bean id="fileChangedReloadingStrategy" class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy">
        <property name="configuration" ref="configuration"></property>
    </bean>

    <bean id="purl" class="java.net.URL">
        <constructor-arg>
            <value>file:#{systemProperties['exe.path']}</value>
        </constructor-arg>
    </bean>

    <bean id="configuration" class="org.apache.commons.configuration.PropertiesConfiguration">
        <constructor-arg ref="purl"/>
        <property name="reloadingStrategy" ref="fileChangedReloadingStrategy"></property>
    </bean>

    <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>file:#{systemProperties['exe.path']}</value>
            </list>
        </property>
    </bean>

    <!-- 缓存管理器 -->
    <!-- <bean id="cacheManager"
        class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
        lazy-init="false">
        <property name="configLocation">
            <value>classpath:ehcache.xml</value>
        </property>
    </bean> -->

    <!-- 缓存 -->
    <!-- <bean id="dbCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean" lazy-init="false">
        <property name="cacheManager">
            <ref bean="cacheManager" />
        </property>
        <property name="cacheName">
            <value>dbCache</value>
        </property>
    </bean> -->

    <import resource="dataSourceContent.xml"/>
    <import resource="quartzContext.xml"/>
</beans>
