开发者

Findout how long a job has been running in Quartz

开发者 https://www.devze.com 2023-02-09 17:20 出处:网络
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 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开发者_StackOverflow社区 to find it.

Could some one suggest me a way of finding how long a job has been running?

Thanks, Abi


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消