spring-quartz.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. xsi:schemaLocation="http://www.springframework.org/schema/beans
  5. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  6. <!-- <import resource="contextBeans.xml" /> -->
  7. <bean name="synResource" class="com.fuzamei.task.BlockChainTask"/>
  8. <!-- 定期更新权重 -->
  9. <bean name="scanBlockChainJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  10. <property name="targetObject" ref="synResource" />
  11. <property name="targetMethod" value="updateWeight" />
  12. <property name="concurrent" value="false" />
  13. </bean>
  14. <bean id="scanBlockChainTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
  15. <property name="jobDetail" ref="scanBlockChainJob"/>
  16. <property name="cronExpression" value="* */2 * * * ?" />
  17. </bean>
  18. <!-- 定期更新统计数据 -->
  19. <bean name="scanBlockChainJob1" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  20. <property name="targetObject" ref="synResource" />
  21. <property name="targetMethod" value="updateInfoToStatistical" />
  22. <property name="concurrent" value="false" />
  23. </bean>
  24. <bean id="scanBlockChainTrigger1" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
  25. <property name="jobDetail" ref="scanBlockChainJob1"/>
  26. <property name="cronExpression" value="*/2 * * * * ?" />
  27. </bean>
  28. <!-- 定期轮询区块链接口 -->
  29. <bean name="scanBlockChainJob2" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  30. <property name="targetObject" ref="synResource" />
  31. <property name="targetMethod" value="updateCaseDetail" />
  32. <property name="concurrent" value="false" />
  33. </bean>
  34. <bean id="scanBlockChainTrigger2" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
  35. <property name="jobDetail" ref="scanBlockChainJob2"/>
  36. <property name="cronExpression" value="*/2 * * * * ?" />
  37. </bean>
  38. <!-- 启动调度器 -->
  39. <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
  40. <property name="triggers">
  41. <list>
  42. <!-- <ref bean="scanBlockChainTrigger"/>
  43. <ref bean="scanBlockChainTrigger1"/>
  44. <ref bean="scanBlockChainTrigger2"/> -->
  45. </list>
  46. </property>
  47. </bean>
  48. </beans>