Spring+quartz 做定时任务时,每5分种执行一次,怎么写法
1个回答
2015-08-11 · 知道合伙人软件行家
关注
展开全部
<bean id="StaticPageQuartz" class="com.test.quartz.pageconvertor.StaticPageConvertor" />
<bean id="BuildStaticPageTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="StaticPageQuartz" />
<property name="targetMethod" value="doHTMLConvertor" />
<property name="concurrent" value="false" />
</bean>
<bean id="BuildStaticPageTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="BuildStaticPageTask" />
<property name="cronExpression" value="0 0/5 * * * ?" /><!--每五分钟执行一次-->
</bean>
希望对你有所帮助!
<bean id="BuildStaticPageTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="StaticPageQuartz" />
<property name="targetMethod" value="doHTMLConvertor" />
<property name="concurrent" value="false" />
</bean>
<bean id="BuildStaticPageTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="BuildStaticPageTask" />
<property name="cronExpression" value="0 0/5 * * * ?" /><!--每五分钟执行一次-->
</bean>
希望对你有所帮助!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询