spring定时任务
Posted wdnnccey
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring定时任务相关的知识,希望对你有一定的参考价值。
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"> <beans> <!-- 任务类 --> <bean id="healthCheckupTask" class="org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass" value="com.demo.task.HealthCheckupTask"></property> </bean> <!-- 调度触发器 --> <bean id="healthCheckupTaskTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="healthCheckupTask" /> <property name="cronExpression" value="0 0/10 * * * ?"></property> </bean> <!-- 调度工厂 --> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="healthCheckupTaskTrigger" /> </list> </property> </bean> </beans>
以上是关于spring定时任务的主要内容,如果未能解决你的问题,请参考以下文章