appWebService.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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:task="http://www.springframework.org/schema/task"
  7. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  8. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
  9. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
  10. http://www.springframework.org/schema/aop
  11. http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
  12. http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd">
  13. <!-- 扫描service包下所有使用注解的类型 -->
  14. <context:component-scan base-package="com.izouma.awesomeadmin.service" />
  15. <!-- 配置事务管理器 -->
  16. <bean id="transactionManager"
  17. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  18. <!-- 注入数据库连接池 -->
  19. <property name="dataSource" ref="dataSource" />
  20. </bean>
  21. <!-- 配置基于注解的声明事务 默认使用注解来管理事务行为 -->
  22. <tx:annotation-driven transaction-manager="transactionManager" />
  23. <task:annotation-driven/> <!-- 定时器开关-->
  24. <!--自动开始房间定时任务-->
  25. <bean id="houseInfoTask" class="com.izouma.awesomeadmin.web.HouseInfoController"></bean>
  26. <task:scheduled-tasks>
  27. <task:scheduled ref="houseInfoTask" method="autoBegin" cron="0 0/5 * * * ? "/>
  28. <task:scheduled ref="houseInfoTask" method="autoNoStartPlay" cron="0 0/1 * * * ? "/>
  29. </task:scheduled-tasks>
  30. </beans>