applicationContext.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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"
  4. xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:task="http://www.springframework.org/schema/task"
  7. xmlns:cache="http://www.springframework.org/schema/cache"
  8. xsi:schemaLocation="http://www.springframework.org/schema/beans
  9. http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  10. http://www.springframework.org/schema/context
  11. http://www.springframework.org/schema/context/spring-context-4.0.xsd
  12. http://www.springframework.org/schema/aop
  13. http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
  14. http://www.springframework.org/schema/task
  15. http://www.springframework.org/schema/task/spring-task.xsd
  16. http://www.springframework.org/schema/cache
  17. http://www.springframework.org/schema/cache/spring-cache.xsd">
  18. <!-- 管家收缴率 -->
  19. <context:component-scan
  20. base-package="com.salesforce"/>
  21. <!-- <cache:annotation-driven /> -->
  22. <!-- <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
  23. p:cache-manager-ref="ehcache" /> -->
  24. <!-- EhCache library setup -->
  25. <!-- <bean id="ehcache"
  26. class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
  27. p:config-location="classpath:ehcache.xml" p:shared="true" /> -->
  28. <aop:aspectj-autoproxy proxy-target-class="true" />
  29. <import resource="dataSource.xml" />
  30. <!-- 支持上传文件 -->
  31. <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  32. <property name="maxUploadSize" value="20971520" />
  33. <property name="defaultEncoding" value="UTF-8" />
  34. <property name="uploadTempDir" value="uploadFile" />
  35. </bean>
  36. <bean id="applicationProperties"
  37. class="org.springframework.beans.factory.config.PropertiesFactoryBean">
  38. <property name="locations">
  39. <list>
  40. <value>classpath:/application.properties</value>
  41. </list>
  42. </property>
  43. </bean>
  44. <bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
  45. <property name="configLocation" value="classpath:spring/ehcache.xml"/>
  46. </bean>
  47. <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
  48. <property name="cacheManager" ref="cacheManagerFactory"/>
  49. </bean>
  50. <cache:annotation-driven/>
  51. <!--短信管理器-->
  52. <bean id="smsBaseManager" class="cn.com.countrygarden.bi.main.sms.SmsBaseManager">
  53. <constructor-arg name="appkey" value="${sms.appkey}"/>
  54. <constructor-arg name="appSecret" value="${sms.appSecret}"/>
  55. <constructor-arg name="appUrl" value="${sms.appUrl}"/>
  56. <constructor-arg name="appPersonUrl" value="${sms.personnel.appUrl}"/>
  57. </bean>
  58. <!--短信同步客户端-->
  59. <bean id="syncApiClientSmsService"
  60. factory-bean="smsBaseManager"
  61. factory-method="getSyncClientInstance"
  62. class="cn.com.countrygarden.bi.main.sms.client.SyncApiClientSmsService"/>
  63. <!--短信异步客户端-->
  64. <bean id="asyncApiClientSmsService"
  65. factory-bean="smsBaseManager"
  66. factory-method="getASyncClientInstance"
  67. class="cn.com.countrygarden.bi.main.sms.client.AsyncApiClientSmsService"/>
  68. <!-- spring thread pool executor -->
  69. <bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
  70. <property name="corePoolSize" value="10" />
  71. <property name="keepAliveSeconds" value="200" />
  72. <property name="maxPoolSize" value="15" />
  73. <property name="queueCapacity" value="20" />
  74. <property name="rejectedExecutionHandler">
  75. <bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy" />
  76. </property>
  77. </bean>
  78. </beans>