当前位置: 首页>>代码示例>>Java>>正文


Java TriggerState.NONE属性代码示例

本文整理汇总了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();
	}
}
 
开发者ID:RedisLabs,项目名称:redis-quartz,代码行数:26,代码来源:RedisJobStore.java

示例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;
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:17,代码来源:AbstractQuartzTaskManager.java

示例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;
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:43,代码来源:RAMJobStore.java

示例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);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:40,代码来源:JobStoreSupport.java


注:本文中的org.quartz.Trigger.TriggerState.NONE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。