applicationContext.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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:aop="http://www.springframework.org/schema/aop"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
  6. xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:tx="http://www.springframework.org/schema/tx"
  7. xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:task="http://www.springframework.org/schema/task"
  8. xsi:schemaLocation="
  9. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  10. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
  11. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
  12. http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
  13. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
  14. http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd
  15. http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
  16. http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">
  17. <!-- 读入配置属性文件 -->
  18. <context:property-placeholder location="classpath:/dbconfig.properties,classpath:/application.properties"/>
  19. <!-- 持久化扫描 -->
  20. <context:component-scan base-package="com.rtrh.core.repository" />
  21. <context:component-scan base-package="com.rtrh.projects" />
  22. <!-- 注入shiro中需要的依赖 -->
  23. <context:component-scan base-package="com.team" />
  24. <!-- 系统核心插件扫描 -->
  25. <context:component-scan base-package="com.rtrh.core.plugins" annotation-config="true">
  26. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
  27. </context:component-scan>
  28. <!-- 系统通用模块扫描 -->
  29. <context:component-scan base-package="com.rtrh.common.modules" annotation-config="true">
  30. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
  31. </context:component-scan>
  32. <!-- 核心security扫描
  33. <context:component-scan base-package="com.rtrh.core.security" annotation-config="true">
  34. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
  35. </context:component-scan>
  36. -->
  37. <context:component-scan base-package="com.rtrh.projects.modules" annotation-config="true">
  38. <context:exclude-filter type="annotation"
  39. expression="org.springframework.stereotype.Controller" />
  40. </context:component-scan>
  41. <!-- Activates scanning of @Autowired -->
  42. <context:annotation-config />
  43. <!-- 事件管理配置 -->
  44. <import resource="classpath*:/rtrh-event.xml" />
  45. <!-- 文件库配置 -->
  46. <import resource="classpath*:/rtrh-filesystem.xml" />
  47. <!-- 邮箱配置 -->
  48. <!-- <import resource="classpath*:/rtrh-email.xml" /> -->
  49. <!-- 短信配置 -->
  50. <import resource="classpath*:/rtrh-vcode.xml" />
  51. <!-- 加解密配置 -->
  52. <import resource="classpath*:/rtrh-crypto.xml" />
  53. <!-- 定时任务 -->
  54. <import resource="classpath*:/rtrh-schedule.xml" />
  55. <!-- 数据源定义 -->
  56. <import resource="classpath*:/rtrh-datasource.xml" />
  57. <import resource="classpath*:/rtrh-hibernate.xml" />
  58. <import resource="classpath*:/rtrh-mybatis.xml" />
  59. <import resource="classpath:/applicationContext-memcached.xml" />
  60. <import resource="classpath:security/applicationContext-shiro.xml" />
  61. <!-- 线程池 -->
  62. <bean id="threadPool" scope="prototype" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
  63. <!-- 线程池维护线程的最少数量 -->
  64. <property name="corePoolSize" value="50" />
  65. <!-- 线程池维护线程所允许的空闲时间 -->
  66. <property name="keepAliveSeconds" value="300000" />
  67. <!-- 线程池维护线程的最大数量 -->
  68. <property name="maxPoolSize" value="2000" />
  69. <!-- 线程池所使用的缓冲队列 -->
  70. <property name="queueCapacity" value="1000000" />
  71. <property name="rejectedExecutionHandler">
  72. <bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy" />
  73. </property>
  74. </bean>
  75. <!-- 方法拦截器,跟踪方法调用 -->
  76. <bean id="ExecutionMethodInterceptor" class="com.rtrh.core.spring.intercepter.ExecutionMethodInterceptor" />
  77. <aop:config proxy-target-class="true">
  78. <!-- !execution(* com.xxx.flipclass.sdk.client.interfaces..*.loginInfoService.*(..))
  79. and (execution(* com.xxx.*.sdk.client.interfaces..*.*Client*.*(..))
  80. || execution(* com.xxx.*.sdk.client.interfaces..*.*Service*.*(..)))
  81. -->
  82. <aop:pointcut id="ExecutionMethodPointcut" expression="execution(* com.rtrh.core.modules..*.*Manager.*(..))" />
  83. <aop:advisor advice-ref="ExecutionMethodInterceptor" pointcut-ref="ExecutionMethodPointcut" />
  84. </aop:config>
  85. <beans profile="development,test">
  86. </beans>
  87. </beans>