job.xml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
  3. <beans>
  4. <bean id="bdzjob" class="org.springframework.scheduling.quartz.JobDetailBean">
  5. <property name="jobClass">
  6. <value>com.gyee.timer.TableBottomValueJob</value>
  7. </property>
  8. <property name="jobDataAsMap">
  9. <map>
  10. <entry key="tableBottomValueService" value-ref="tableBottomValueService" />
  11. </map>
  12. </property>
  13. </bean>
  14. <!-- 这种配置可以精确几点执行定时任务 -->
  15. <bean id="bdjobcronQuartzClock" class="org.springframework.scheduling.quartz.CronTriggerBean">
  16. <property name="jobDetail" ref="bdzjob" />
  17. <property name="cronExpression">
  18. <value>0 40 0 ? * *</value>
  19. </property>
  20. </bean>
  21. <!--启动定时任务 -->
  22. <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
  23. <property name="triggers">
  24. <list>
  25. <ref bean="bdjobcronQuartzClock" />
  26. </list>
  27. </property>
  28. </bean>
  29. </beans>