获取石英调度程序中的触发器计数?

编程入门 行业动态 更新时间:2024-10-16 00:22:54
本文介绍了获取石英调度程序中的触发器计数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在我的应用程序中使用石英调度程序和 spring,我想获取触发器被触发时的执行次数(即第一次、第二次、第三次等等.我想获取已经执行的触发器的数量.有什么办法吗?提前致谢

I am using quartz scheduler along with spring in my application and i want to get the number of the execution when the trigger is fired (i.e) first time, second time, third time and so on. i want to get the number of trigger that has already executed. is there any way? thanks in advance

推荐答案

为了简单起见:如何向作业对象添加一个变量,该变量在每次作业执行时都被 ++ 处理?例如:

Just to keep it simple: how about adding a variable to the job object which is ++'ed every time that job executed? For example:

private AtomicInteger counter = new AtomicInteger(0); public void run() { counter.incrementAndGet(); ... } public int getRunCount() { counter.get(); }

除此之外 - 我认为 Quartz 中没有任何内部方法来跟踪作业运行的次数.

Other than that - I don't think there are any internal methods in Quartz to keep track of how many times the job ran.

更多推荐

获取石英调度程序中的触发器计数?

本文发布于:2023-11-24 13:28:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1625388.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:触发器   程序   石英

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!