本文整理匯總了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);
}
}