當前位置: 首頁>>代碼示例>>Java>>正文


Java Trigger.STATE_NONE屬性代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:AsuraTeam,項目名稱:asura,代碼行數:45,代碼來源:RAMJobStore.java

示例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);
    }
}
 
開發者ID:AsuraTeam,項目名稱:asura,代碼行數:43,代碼來源:JobStoreSupport.java


注:本文中的org.quartz.Trigger.STATE_NONE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。