applicationContext.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  4. xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:util="http://www.springframework.org/schema/util" xmlns:cache="http://www.springframework.org/schema/cache"
  7. xsi:schemaLocation="
  8. http://www.springframework.org/schema/beans
  9. http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
  10. http://www.springframework.org/schema/tx
  11. http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
  12. http://www.springframework.org/schema/context
  13. http://www.springframework.org/schema/context/spring-context-3.2.xsd
  14. http://www.springframework.org/schema/util
  15. http://www.springframework.org/schema/util/spring-util-3.2.xsd
  16. http://www.springframework.org/schema/cache
  17. http://www.springframework.org/schema/cache/spring-cache-3.2.xsd
  18. http://www.springframework.org/schema/aop
  19. http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">
  20. <context:annotation-config />
  21. <tx:annotation-driven />
  22. <!-- <cache:annotation-driven cache-manager="cacheManager" /> -->
  23. <context:component-scan base-package="com.tl.cdz">
  24. <context:exclude-filter type="annotation"
  25. expression="org.springframework.stereotype.Controller" />
  26. </context:component-scan>
  27. <bean id="propertyConfigurer" class="com.xc.opal.base.utils.ApplicationPropertyUtils">
  28. <property name="ignoreUnresolvablePlaceholders" value="true" />
  29. <property name="locations">
  30. <list>
  31. <value>/WEB-INF/config/platform/jdbc.properties</value>
  32. <value>/WEB-INF/config/platform/platform.properties</value>
  33. </list>
  34. </property>
  35. </bean>
  36. <bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource"
  37. destroy-method="close">
  38. <property name="driverClass" value="${jdbc.driverClassName}" />
  39. <property name="jdbcUrl" value="${jdbc.url}" />
  40. <property name="username" value="${jdbc.username}" />
  41. <property name="password" value="${jdbc.password}" />
  42. <property name="idleConnectionTestPeriodInMinutes" value="60" />
  43. <property name="idleMaxAgeInMinutes" value="240" />
  44. <property name="partitionCount" value="3" />
  45. <property name="maxConnectionsPerPartition" value="30" />
  46. <property name="minConnectionsPerPartition" value="10" />
  47. <property name="acquireIncrement" value="5" />
  48. <property name="statementsCacheSize" value="100" />
  49. <property name="releaseHelperThreads" value="3" />
  50. <property name="statementReleaseHelperThreads" value="3" />
  51. </bean>
  52. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  53. <property name="dataSource" ref="dataSource" />
  54. </bean>
  55. <bean id="transactionManager"
  56. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  57. <property name="dataSource" ref="dataSource"></property>
  58. </bean>
  59. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  60. <property name="dataSource" ref="dataSource" />
  61. <!-- 自动扫描映射xml文件,可以多个 -->
  62. <property name="mapperLocations">
  63. <list>
  64. <value>classpath*:com/tl/cdz/third/**/*Mapper.xml</value>
  65. </list>
  66. </property>
  67. <!-- 配置自定义类型转换包路径 -->
  68. <property name="plugins">
  69. <array>
  70. <bean class="com.github.pagehelper.PageHelper">
  71. <property name="properties">
  72. <value>
  73. dialect=mysql
  74. offsetAsPageNum=true
  75. rowBoundsWithCount=true
  76. reasonable=true
  77. cacheEnabled=false
  78. </value>
  79. </property>
  80. </bean>
  81. </array>
  82. </property>
  83. </bean>
  84. <!--MyBatis的sqlSession配置 -->
  85. <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
  86. <constructor-arg index="0" ref="sqlSessionFactory" />
  87. </bean>
  88. <bean id="ApplicationHelper" class="com.xc.opal.base.common.ApplicationHelper"></bean>
  89. <!-- cache -->
  90. <!-- <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
  91. p:cache-manager-ref="ehcache" />
  92. <bean id="ehcache"
  93. class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
  94. p:config-location="/WEB-INF/config/platform/ehcache.xml" />
  95. -->
  96. <!-- restTemplate配置 -->
  97. <bean id="httpClientFactory"
  98. class="com.xc.opal.common.resttemplate.HttpClientHttpRequestFactory">
  99. <constructor-arg type="java.lang.String" value="http" />
  100. <constructor-arg type="java.lang.String" value="9090" />
  101. </bean>
  102. <bean id="restTemplate" class="com.xc.opal.common.resttemplate.OpalRestTemplate">
  103. <constructor-arg ref="httpClientFactory" />
  104. <property name="restUrl" value="${ISC_ADAPTER_URL}" />
  105. <property name="messageConverters">
  106. <list>
  107. <bean
  108. class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
  109. <bean class="org.springframework.http.converter.FormHttpMessageConverter" />
  110. <bean
  111. class="org.springframework.http.converter.xml.SourceHttpMessageConverter" />
  112. </list>
  113. </property>
  114. </bean>
  115. <!-- <bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
  116. <constructor-arg ref="httpClientFactory" /> <property name="messageConverters">
  117. <list> <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"
  118. /> <bean class="org.springframework.http.converter.FormHttpMessageConverter"
  119. /> <bean class="org.springframework.http.converter.xml.SourceHttpMessageConverter"
  120. /> </list> </property> </bean> -->
  121. <!-- SMS短信服务配置 -->
  122. <!-- <import resource="applicationContext-sms.xml" /> -->
  123. <import resource="applicationContext-msdk.xml" />
  124. <import resource="applicationContext-call.xml"/>
  125. </beans>