本文整理汇总了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;
}
示例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();
}
示例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;
}