使用Quartz只运行一次Job [英] Running a Job only once Using Quartz

查看:140
本文介绍了使用Quartz只运行一次Job的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在Java中使用Quartz只运行一次作业?我知道在这种情况下使用Quartz是没有意义的。但事实是,我有多个工作,他们多次运行。所以,我正在使用Quartz。

Is there a way I could run a job only once using Quartz in Java? I understand it does not make sense to use Quartz in this case. But, the thing is, I have multiple jobs and they are run multiple times. So, I am using Quartz.

这是否可能?

推荐答案

你应该使用在特定时间触发而不重复的SimpleTrigger。 TriggerUtils有许多方便的方法来创建这类东西。

You should use SimpleTrigger that fires at specific time and without repeating. TriggerUtils has many handy methods for creating these kind of things.

这篇关于使用Quartz只运行一次Job的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆