rest-content.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:websocket="http://www.springframework.org/schema/websocket"
  7. 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/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  12. http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket.xsd
  13. http://www.springframework.org/schema/task
  14. http://www.springframework.org/schema/task/spring-task-3.1.xsd">
  15. <bean id="propertyConfigurer"
  16. class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  17. <property name="locations">
  18. <list>
  19. <value>classpath*:config.properties</value>
  20. <value>classpath*:jdbc.properties</value>
  21. </list>
  22. </property>
  23. </bean>
  24. <!-- 不扫描带有@Controller注解的类。因为这些类已经随容器启动时,在rest-servlet中扫描过一遍了 交给springMVC
  25. 扫描实例化 -->
  26. <context:component-scan base-package="com.loygra.mooring">
  27. <context:exclude-filter type="annotation"
  28. expression="org.springframework.stereotype.Controller" />
  29. </context:component-scan>
  30. <!-- task任务扫描注解 -->
  31. <task:annotation-driven />
  32. <!-- 对标注@Transaction注解的Bean进行事务管理 -->
  33. <tx:annotation-driven transaction-manager="txManager" />
  34. <!-- ********** http任务执行线程池 start ************* -->
  35. <bean id="taskExecutor"
  36. class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
  37. <property name="corePoolSize" value="2" />
  38. <property name="maxPoolSize" value="5" />
  39. <property name="queueCapacity" value="6" />
  40. <property name="keepAliveSeconds" value="2000" />
  41. <property name="rejectedExecutionHandler">
  42. <bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy" />
  43. </property>
  44. </bean>
  45. <!-- ********** http任务执行线程池 end ************* -->
  46. <bean id="velocityEngine"
  47. class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
  48. <property name="velocityProperties">
  49. <props>
  50. <prop key="resource.loader">file</prop>
  51. <prop key="file.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
  52. </prop>
  53. <prop key="file.resource.loader.cache">false</prop>
  54. <prop key="file.resource.loader.modificationCheckInterval">3</prop>
  55. <prop key="input.encoding">UTF-8</prop>
  56. <prop key="output.encoding">UTF-8</prop>
  57. </props>
  58. </property>
  59. </bean>
  60. <bean id="javaMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
  61. <property name="host">
  62. <value>${mail.host}</value>
  63. </property>
  64. <property name="port">
  65. <value>${mail.port}</value>
  66. </property>
  67. <property name="javaMailProperties">
  68. <props>
  69. <prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
  70. <prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>
  71. </props>
  72. </property>
  73. <property name="username">
  74. <value>${mail.username}</value>
  75. </property>
  76. <property name="password">
  77. <value>${mail.password}</value>
  78. </property>
  79. </bean>
  80. <!-- websocket -->
  81. <bean id="websocket" class="com.loygra.mooring.websocket.WebsocketEndPoint"/>
  82. <websocket:handlers>
  83. <websocket:mapping path="/websocket" handler="websocket"/>
  84. <websocket:handshake-interceptors>
  85. <bean class="com.loygra.mooring.websocket.HandshakeInterceptor"/>
  86. </websocket:handshake-interceptors>
  87. </websocket:handlers>
  88. <bean id="msaapiService" class="com.yuanxd.tools.hscbdt.HscbdtServiceFactory" factory-method="create"/>
  89. <bean id="nauticalService" class="com.jsjty.xtong.service.NauticalService"></bean>
  90. <import resource="rest-jdbc.xml" />
  91. <import resource="rest-ehcache.xml"/>
  92. <!-- <bean id="applicationContext" class="com.loygra.mooring.util.SpringApplicationContext"
  93. /> -->
  94. </beans>