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


Java SimpleScheduleBuilder.withMisfireHandlingInstructionFireNow方法代码示例

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


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

示例1: getScheduleBuilder

import org.quartz.SimpleScheduleBuilder; //导入方法依赖的package包/类
/**
 * Get a {@link ScheduleBuilder} that is configured to produce a 
 * schedule identical to this trigger's schedule.
 * 
 * @see #getTriggerBuilder()
 */
@Override
public ScheduleBuilder<SimpleTrigger> getScheduleBuilder() {
    
    SimpleScheduleBuilder sb = SimpleScheduleBuilder.simpleSchedule()
    .withIntervalInMilliseconds(getRepeatInterval())
    .withRepeatCount(getRepeatCount());
    
    switch(getMisfireInstruction()) {
        case MISFIRE_INSTRUCTION_FIRE_NOW : sb.withMisfireHandlingInstructionFireNow();
        break;
        case MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT : sb.withMisfireHandlingInstructionNextWithExistingCount();
        break;
        case MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT : sb.withMisfireHandlingInstructionNextWithRemainingCount();
        break;
        case MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT : sb.withMisfireHandlingInstructionNowWithExistingCount();
        break;
        case MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT : sb.withMisfireHandlingInstructionNowWithRemainingCount();
        break;
    }
    
    return sb;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:SimpleTriggerImpl.java

示例2: convert

import org.quartz.SimpleScheduleBuilder; //导入方法依赖的package包/类
@Override
public Trigger convert(Immediate trigger) {
    SimpleScheduleBuilder simpleSchedule = SimpleScheduleBuilder.simpleSchedule();
    if (trigger.getMisfireInstruction() == Immediate.MisfireInstruction.DROP) {
        simpleSchedule = simpleSchedule.withMisfireHandlingInstructionIgnoreMisfires();
    } else if (trigger.getMisfireInstruction() == Immediate.MisfireInstruction.FIRE_NOW) {
        simpleSchedule = simpleSchedule.withMisfireHandlingInstructionFireNow();
    }
    return newTrigger()
            .withIdentity(trigger.getTriggerKey().getName(), trigger.getTriggerKey().getGroup())
            .forJob(trigger.getJobKey().getName(), trigger.getJobKey().getGroup())
            .withDescription(trigger.getDescription())
            .withSchedule(simpleSchedule)
            .usingJobData(new JobDataMap(trigger.getTriggerData()))
            .startNow()
            .build();
}
 
开发者ID:taboola,项目名称:taboola-cronyx,代码行数:18,代码来源:ImmediateConverter.java

示例3: setMisfirePolicyForSimpleTrigger

import org.quartz.SimpleScheduleBuilder; //导入方法依赖的package包/类
private SimpleScheduleBuilder setMisfirePolicyForSimpleTrigger(SimpleScheduleBuilder simpleSchedule, String motechMisfireProperty) {
    Integer misfirePolicy = simpleTriggerMisfirePolicies.get(motechMisfireProperty);
    if (misfirePolicy == null) {
        misfirePolicy = SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT;
    }
    if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_SMART_POLICY)) {
        return simpleSchedule;
    }
    if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW)) {
        return simpleSchedule.withMisfireHandlingInstructionFireNow();
    }
    if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY)) {
        return simpleSchedule.withMisfireHandlingInstructionIgnoreMisfires();
    }
    if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT)) {
        return simpleSchedule.withMisfireHandlingInstructionNextWithExistingCount();
    }
    if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT)) {
        return simpleSchedule.withMisfireHandlingInstructionNextWithRemainingCount();
    }
    if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT)) {
        return simpleSchedule.withMisfireHandlingInstructionNowWithExistingCount();
    }
    if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT)) {
        return simpleSchedule.withMisfireHandlingInstructionNowWithRemainingCount();
    }
    return simpleSchedule;
}
 
开发者ID:motech,项目名称:motech,代码行数:29,代码来源:MotechSchedulerServiceImpl.java


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