applicationContext.xml 5.67 KB
Newer Older
frank.xa.zhang's avatar
frank.xa.zhang committed
1 2 3
<?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"
4
       xmlns:tx="http://www.springframework.org/schema/tx"
frank.xa.zhang's avatar
frank.xa.zhang committed
5 6 7
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:cache="http://www.springframework.org/schema/cache"
       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.3.xsd
8

frank.xa.zhang's avatar
frank.xa.zhang committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
  <!-- 添加properties文件 -->
  <bean id="standardPBEStringEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
    <property name="password" value="${atms_password:k5Cs7OmB5HdtVDOw94Py2V8HOvfmgbzeX9UCWDciqcjfhOulQLRuuJZkgV9zyIvO6QG22ZxOoYiJlCKrYP07O6nPFpcmN3XyNLJ}" />
  </bean>

  <bean id="encryptablePropertyPlaceholderConfigurer" class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
    <property name="ignoreUnresolvablePlaceholders" value="true" />
    <constructor-arg ref="standardPBEStringEncryptor" />
    <property name="locations">
      <list>
        <!-- Base settings for all environments -->
        <value>classpath:conf/conf_base.properties</value>
        <!-- Settings for selected environment -->
        <value>classpath:conf/conf.properties</value>
      </list>
    </property>
  </bean>

29 30 31 32 33
  <bean id="validator"
        class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
    <property name="providerClass"
              value="org.hibernate.validator.HibernateValidator" />
  </bean>
frank.xa.zhang's avatar
frank.xa.zhang committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
  <!-- **************************************************************** -->
  <!-- 启用注解, 启用component-scan -->
  <!-- **************************************************************** -->
  <context:component-scan base-package="pwc.taxtech.atms" >
  	<context:exclude-filter type="annotation" expression="pwc.taxtech.atms.WebContext"/>
  </context:component-scan>

  <import resource="applicationContext-datasource.xml" />

  <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="configLocation" value="classpath:sqlMapConfig.xml" />
    <property name="mapperLocations">
      <array>
        <value>classpath*:pwc/taxtech/atms/**/*Mapper.xml</value>
      </array>
    </property>
  </bean>

  <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
    <constructor-arg ref="sqlSessionFactory" />
  </bean>

  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
  </bean>

  <tx:advice id="txAdvice">
    <tx:attributes>
      <tx:method name="*" propagation="REQUIRED" rollback-for="Exception" />
    </tx:attributes>
  </tx:advice>

  <aop:config proxy-target-class="true">
    <aop:pointcut id="txPointcut2" expression="execution(public * pwc.taxtech.atms..*.*(..)) &amp;&amp;
     @target(org.springframework.stereotype.Service)" />
    <aop:advisor pointcut-ref="txPointcut2" advice-ref="txAdvice" />
  </aop:config>

  <aop:aspectj-autoproxy />

  <tx:annotation-driven proxy-target-class="true" />

  <!-- 缓存配置 -->
  <!-- 启用缓存注解功能(请将其配置在Spring主配置文件中) -->
  <cache:annotation-driven cache-manager="cacheManager"/>
  <bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="configLocation" value="classpath:ehcache.xml"/>
  </bean>
  <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
    <property name="cacheManager" ref="cacheManagerFactory"/>
  </bean>

  <!-- atms activit for workflow-->
88 89 90 91 92 93 94 95 96
  <!--<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">-->
    <!--<property name="dataSource" ref="dataSource"/>-->
    <!--<property name="transactionManager" ref="transactionManager"/>-->
    <!--<property name="databaseSchemaUpdate" value="true"/>-->
    <!--<property name="jobExecutorActivate" value="false"/>-->
    <!--&lt;!&ndash; 以下2个是为了防止生成流程图片时出现乱码 &ndash;&gt;-->
    <!--<property name="activityFontName" value="宋体"/>-->
    <!--<property name="labelFontName" value="宋体"/>-->
  <!--</bean>-->
frank.xa.zhang's avatar
frank.xa.zhang committed
97 98

  <!-- 流程引擎 -->
99 100 101
  <!--<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">-->
    <!--<property name="processEngineConfiguration" ref="processEngineConfiguration"/>-->
  <!--</bean>-->
frank.xa.zhang's avatar
frank.xa.zhang committed
102 103

  <!-- 流程服务 -->
104 105 106 107 108 109 110 111 112 113 114 115
  <!--<bean id="repositoryService" factory-bean="processEngine"-->
        <!--factory-method="getRepositoryService"/>-->
  <!--<bean id="runtimeService" factory-bean="processEngine"-->
        <!--factory-method="getRuntimeService"/>-->
  <!--<bean id="taskService" factory-bean="processEngine"-->
        <!--factory-method="getTaskService"/>-->
  <!--<bean id="historyService" factory-bean="processEngine"-->
        <!--factory-method="getHistoryService"/>-->
  <!--<bean id="managementService" factory-bean="processEngine"-->
        <!--factory-method="getManagementService"/>-->
  <!--<bean id="identityService" factory-bean="processEngine"-->
        <!--factory-method="getIdentityService"/>-->
frank.xa.zhang's avatar
frank.xa.zhang committed
116 117

</beans>