本文整理汇总了Java中org.quartz.Trigger.TriggerState.NONE属性的典型用法代码示例。如果您正苦于以下问题:Java TriggerState.NONE属性的具体用法?Java TriggerState.NONE怎么用?Java TriggerState.NONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.quartz.Trigger.TriggerState
的用法示例。
在下文中一共展示了TriggerState.NONE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTriggerState
@Override
public TriggerState getTriggerState(TriggerKey triggerKey)
throws JobPersistenceException {
String triggerHashKey = createTriggerHashKey(triggerKey.getGroup(), triggerKey.getName());
try (Jedis jedis = pool.getResource()) {
lockPool.acquire();
if (jedis.zscore(RedisTriggerState.PAUSED.getKey(), triggerHashKey) != null || jedis.zscore(RedisTriggerState.PAUSED_BLOCKED.getKey(), triggerHashKey)!= null)
return TriggerState.PAUSED;
else if (jedis.zscore(RedisTriggerState.BLOCKED.getKey(), triggerHashKey) != null)
return TriggerState.BLOCKED;
else if (jedis.zscore(RedisTriggerState.WAITING.getKey(), triggerHashKey) != null || jedis.zscore(RedisTriggerState.ACQUIRED.getKey(), triggerHashKey) != null)
return TriggerState.NORMAL;
else if (jedis.zscore(RedisTriggerState.COMPLETED.getKey(), triggerHashKey) != null)
return TriggerState.COMPLETE;
else if (jedis.zscore(RedisTriggerState.ERROR.getKey(), triggerHashKey) != null)
return TriggerState.ERROR;
else
return TriggerState.NONE;
} catch (Exception ex) {
log.error("could not get trigger state: " + triggerHashKey, ex);
throw new JobPersistenceException(ex.getMessage(), ex.getCause());
} finally {
lockPool.release();
}
}
示例2: triggerStateToTaskState
private TaskState triggerStateToTaskState(TriggerState triggerState) {
if (triggerState == TriggerState.NONE) {
return TaskState.NONE;
} else if (triggerState == TriggerState.PAUSED) {
return TaskState.PAUSED;
} else if (triggerState == TriggerState.COMPLETE) {
return TaskState.FINISHED;
} else if (triggerState == TriggerState.ERROR) {
return TaskState.ERROR;
} else if (triggerState == TriggerState.NORMAL) {
return TaskState.NORMAL;
} else if (triggerState == TriggerState.BLOCKED) {
return TaskState.BLOCKED;
} else {
return TaskState.UNKNOWN;
}
}
示例3: getTriggerState
/**
* <p>
* Get the current state of the identified <code>{@link Trigger}</code>.
* </p>
*
* @see TriggerState#NORMAL
* @see TriggerState#PAUSED
* @see TriggerState#COMPLETE
* @see TriggerState#ERROR
* @see TriggerState#BLOCKED
* @see TriggerState#NONE
*/
public TriggerState getTriggerState(TriggerKey triggerKey) throws JobPersistenceException {
synchronized(lock) {
TriggerWrapper tw = triggersByKey.get(triggerKey);
if (tw == null) {
return TriggerState.NONE;
}
if (tw.state == TriggerWrapper.STATE_COMPLETE) {
return TriggerState.COMPLETE;
}
if (tw.state == TriggerWrapper.STATE_PAUSED) {
return TriggerState.PAUSED;
}
if (tw.state == TriggerWrapper.STATE_PAUSED_BLOCKED) {
return TriggerState.PAUSED;
}
if (tw.state == TriggerWrapper.STATE_BLOCKED) {
return TriggerState.BLOCKED;
}
if (tw.state == TriggerWrapper.STATE_ERROR) {
return TriggerState.ERROR;
}
return TriggerState.NORMAL;
}
}
示例4: getTriggerState
public TriggerState getTriggerState(Connection conn, TriggerKey key)
throws JobPersistenceException {
try {
String ts = getDelegate().selectTriggerState(conn, key);
if (ts == null) {
return TriggerState.NONE;
}
if (ts.equals(STATE_DELETED)) {
return TriggerState.NONE;
}
if (ts.equals(STATE_COMPLETE)) {
return TriggerState.COMPLETE;
}
if (ts.equals(STATE_PAUSED)) {
return TriggerState.PAUSED;
}
if (ts.equals(STATE_PAUSED_BLOCKED)) {
return TriggerState.PAUSED;
}
if (ts.equals(STATE_ERROR)) {
return TriggerState.ERROR;
}
if (ts.equals(STATE_BLOCKED)) {
return TriggerState.BLOCKED;
}
return TriggerState.NORMAL;
} catch (SQLException e) {
throw new JobPersistenceException(
"Couldn't determine state of trigger (" + key + "): " + e.getMessage(), e);
}
}