本文整理汇总了Java中org.quartz.Trigger.STATE_NONE属性的典型用法代码示例。如果您正苦于以下问题:Java Trigger.STATE_NONE属性的具体用法?Java Trigger.STATE_NONE怎么用?Java Trigger.STATE_NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.quartz.Trigger
的用法示例。
在下文中一共展示了Trigger.STATE_NONE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTriggerState
/**
* <p>
* Get the current state of the identified <code>{@link Trigger}</code>.
* </p>
*
* @see Trigger#STATE_NORMAL
* @see Trigger#STATE_PAUSED
* @see Trigger#STATE_COMPLETE
* @see Trigger#STATE_ERROR
* @see Trigger#STATE_BLOCKED
* @see Trigger#STATE_NONE
*/
public int getTriggerState(SchedulingContext ctxt, String triggerName,
String groupName) throws JobPersistenceException {
synchronized(lock) {
TriggerWrapper tw = (TriggerWrapper) triggersByFQN.get(TriggerWrapper
.getTriggerNameKey(triggerName, groupName));
if (tw == null) {
return Trigger.STATE_NONE;
}
if (tw.state == TriggerWrapper.STATE_COMPLETE) {
return Trigger.STATE_COMPLETE;
}
if (tw.state == TriggerWrapper.STATE_PAUSED) {
return Trigger.STATE_PAUSED;
}
if (tw.state == TriggerWrapper.STATE_PAUSED_BLOCKED) {
return Trigger.STATE_PAUSED;
}
if (tw.state == TriggerWrapper.STATE_BLOCKED) {
return Trigger.STATE_BLOCKED;
}
if (tw.state == TriggerWrapper.STATE_ERROR) {
return Trigger.STATE_ERROR;
}
return Trigger.STATE_NORMAL;
}
}
示例2: getTriggerState
public int getTriggerState(Connection conn, SchedulingContext ctxt,
String triggerName, String groupName)
throws JobPersistenceException {
try {
String ts = getDelegate().selectTriggerState(conn, triggerName,
groupName);
if (ts == null) {
return Trigger.STATE_NONE;
}
if (ts.equals(STATE_DELETED)) {
return Trigger.STATE_NONE;
}
if (ts.equals(STATE_COMPLETE)) {
return Trigger.STATE_COMPLETE;
}
if (ts.equals(STATE_PAUSED)) {
return Trigger.STATE_PAUSED;
}
if (ts.equals(STATE_PAUSED_BLOCKED)) {
return Trigger.STATE_PAUSED;
}
if (ts.equals(STATE_ERROR)) {
return Trigger.STATE_ERROR;
}
if (ts.equals(STATE_BLOCKED)) {
return Trigger.STATE_BLOCKED;
}
return Trigger.STATE_NORMAL;
} catch (SQLException e) {
throw new JobPersistenceException(
"Couldn't determine state of trigger (" + groupName + "."
+ triggerName + "): " + e.getMessage(), e);
}
}