java 确定石英触发器的暂停状态?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3620290/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Determining Paused State of Quartz Trigger?
提问by hooknc
Is there a way to determine if a specific Trigger in Quartz is in paused state?
有没有办法确定 Quartz 中的特定触发器是否处于暂停状态?
I know of the getPausedTriggerGroups() method on Scheduler, but there doesn't seem to be a way to figure out the paused state of a particular Trigger for a particular JobDetail.
我知道调度程序上的 getPausedTriggerGroups() 方法,但似乎没有办法找出特定 JobDetail 的特定触发器的暂停状态。
Any friendly suggestions?
有什么友好的建议吗?
回答by Jake
According to the API docs, Scheduler.getTriggerState(String triggerName, String triggerGroup) can tell you the state of a particular trigger, returning one of these constants: Trigger.STATE_NORMAL, Trigger.STATE_PAUSED, Trigger.STATE_COMPLETE, Trigger.STATE_ERROR, Trigger.STATE_BLOCKED, Trigger.STATE_NONE
根据 API 文档,Scheduler.getTriggerState(String triggerName, String triggerGroup) 可以告诉您特定触发器的状态,返回以下常量之一:Trigger.STATE_NORMAL、Trigger.STATE_PAUSED、Trigger.STATE_COMPLETE、Trigger.STATE_ERROR、Trigger。 STATE_BLOCKED, Trigger.STATE_NONE
But, yeah, that's not entirely intuitive. :)
但是,是的,这并不完全直观。:)
回答by Robert Christian
Beyond Quartz 1.8.1 this is an enumeration. See import org.quartz.Trigger.TriggerState;
除了 Quartz 1.8.1,这是一个枚举。参见导入 org.quartz.Trigger.TriggerState;

