查明作业在 Quartz 中运行了多长时间
我正在 Quartz 中编写一种开始 - 暂停 - 恢复 - 暂停 - 恢复 -(定期)的工作。我正在使用 SimpleTrigger 进行初始实验。
我想知道如何找到作业运行的时间。我查看了Scheduler类,没有直接找到它的方法。
有人可以建议我一种方法来查找作业运行了多长时间吗?
谢谢, 阿比
I am writing a kind of start - pause - resume - pause - resume -(at regular intervals) kind of job in Quartz. I am using a SimpleTrigger for initial experimentation.
I would like to how I can find the time a job has been running. I looked at the Scheduler class and there were no methods directly to find it.
Could some one suggest me a way of finding how long a job has been running?
Thanks,
Abi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用scheduler.getCurrentlyExecutingJobs()来获取当前正在执行的作业集(或更准确地说,获取每个作业的JobExecutionContext)。
然后,您可以在 JobExecutionContext 上调用 getFireTime() 来查看执行开始的时间。
Call scheduler.getCurrentlyExecutingJobs() to get the set of job's currently executing (or more precisely to get the JobExecutionContext of each).
Then you can call getFireTime() on the JobExecutionContext to see what time the execution started.