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


Java OperableTrigger.getKey方法代码示例

本文整理汇总了Java中org.quartz.spi.OperableTrigger.getKey方法的典型用法代码示例。如果您正苦于以下问题:Java OperableTrigger.getKey方法的具体用法?Java OperableTrigger.getKey怎么用?Java OperableTrigger.getKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.quartz.spi.OperableTrigger的用法示例。


在下文中一共展示了OperableTrigger.getKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TriggerWrapper

import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
TriggerWrapper(OperableTrigger trigger) {
    if(trigger == null)
        throw new IllegalArgumentException("Trigger cannot be null!");
    this.trigger = trigger;
    key = trigger.getKey();
    this.jobKey = trigger.getJobKey();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:RAMJobStore.java

示例2: storeTrigger

import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
/**
 * <p>
 * Insert or update a trigger.
 * </p>
 */
@SuppressWarnings("ConstantConditions")
protected void storeTrigger(Connection conn,
        OperableTrigger newTrigger, JobDetail job, boolean replaceExisting, String state,
        boolean forceState, boolean recovering)
    throws JobPersistenceException {

    boolean existingTrigger = triggerExists(conn, newTrigger.getKey());

    if ((existingTrigger) && (!replaceExisting)) { 
        throw new ObjectAlreadyExistsException(newTrigger); 
    }
    
    try {

        boolean shouldBepaused;

        if (!forceState) {
            shouldBepaused = getDelegate().isTriggerGroupPaused(
                    conn, newTrigger.getKey().getGroup());

            if(!shouldBepaused) {
                shouldBepaused = getDelegate().isTriggerGroupPaused(conn,
                        ALL_GROUPS_PAUSED);

                if (shouldBepaused) {
                    getDelegate().insertPausedTriggerGroup(conn, newTrigger.getKey().getGroup());
                }
            }

            if (shouldBepaused && (state.equals(STATE_WAITING) || state.equals(STATE_ACQUIRED))) {
                state = STATE_PAUSED;
            }
        }

        if(job == null) {
            job = getDelegate().selectJobDetail(conn, newTrigger.getJobKey(), getClassLoadHelper());
        }
        if (job == null) {
            throw new JobPersistenceException("The job ("
                    + newTrigger.getJobKey()
                    + ") referenced by the trigger does not exist.");
        }

        if (job.isConcurrentExectionDisallowed() && !recovering) { 
            state = checkBlockedState(conn, job.getKey(), state);
        }
        
        if (existingTrigger) {
            getDelegate().updateTrigger(conn, newTrigger, state, job);
        } else {
            getDelegate().insertTrigger(conn, newTrigger, state, job);
        }
    } catch (Exception e) {
        throw new JobPersistenceException("Couldn't store trigger '" + newTrigger.getKey() + "' for '" 
                + newTrigger.getJobKey() + "' job:" + e.getMessage(), e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:63,代码来源:JobStoreSupport.java


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