本文整理汇总了Java中org.quartz.CronScheduleBuilder.withMisfireHandlingInstructionDoNothing方法的典型用法代码示例。如果您正苦于以下问题:Java CronScheduleBuilder.withMisfireHandlingInstructionDoNothing方法的具体用法?Java CronScheduleBuilder.withMisfireHandlingInstructionDoNothing怎么用?Java CronScheduleBuilder.withMisfireHandlingInstructionDoNothing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.CronScheduleBuilder
的用法示例。
在下文中一共展示了CronScheduleBuilder.withMisfireHandlingInstructionDoNothing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScheduleBuilder
import org.quartz.CronScheduleBuilder; //导入方法依赖的package包/类
/**
* Get a {@link ScheduleBuilder} that is configured to produce a
* schedule identical to this trigger's schedule.
*
* @see #getTriggerBuilder()
*/
@Override
public ScheduleBuilder<CronTrigger> getScheduleBuilder() {
CronScheduleBuilder cb = CronScheduleBuilder.cronSchedule(getCronExpression())
.inTimeZone(getTimeZone());
switch(getMisfireInstruction()) {
case MISFIRE_INSTRUCTION_DO_NOTHING : cb.withMisfireHandlingInstructionDoNothing();
break;
case MISFIRE_INSTRUCTION_FIRE_ONCE_NOW : cb.withMisfireHandlingInstructionFireAndProceed();
break;
}
return cb;
}
示例2: convert
import org.quartz.CronScheduleBuilder; //导入方法依赖的package包/类
@Override
public Trigger convert(Cron trigger) {
CronScheduleBuilder schedule = cronSchedule(trigger.getCronExpression());
if (trigger.getMisfireInstruction() == Cron.MisfireInstruction.DROP) {
schedule.withMisfireHandlingInstructionDoNothing();
} else if (trigger.getMisfireInstruction() == Cron.MisfireInstruction.FIRE_ONCE) {
schedule.withMisfireHandlingInstructionFireAndProceed();
}
return newTrigger()
.forJob(trigger.getJobKey().getName(), trigger.getJobKey().getGroup())
.withDescription(trigger.getDescription())
.withIdentity(trigger.getTriggerKey().getName(), trigger.getTriggerKey().getGroup())
.withSchedule(schedule)
.usingJobData(new JobDataMap(trigger.getTriggerData()))
.build();
}
示例3: setMisfirePolicyForCronTrigger
import org.quartz.CronScheduleBuilder; //导入方法依赖的package包/类
private CronScheduleBuilder setMisfirePolicyForCronTrigger(CronScheduleBuilder cronSchedule, String motechMisfireProperty) {
Integer misfirePolicyAsInt = cronTriggerMisfirePolicies.get(motechMisfireProperty);
if (misfirePolicyAsInt == null || misfirePolicyAsInt.equals(CronTrigger.MISFIRE_INSTRUCTION_SMART_POLICY)) {
return cronSchedule;
}
if (misfirePolicyAsInt.equals(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING)) {
return cronSchedule.withMisfireHandlingInstructionDoNothing();
}
if (misfirePolicyAsInt.equals(CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW)) {
return cronSchedule.withMisfireHandlingInstructionFireAndProceed();
}
if (misfirePolicyAsInt.equals(CronTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY)) {
return cronSchedule.withMisfireHandlingInstructionIgnoreMisfires();
}
return cronSchedule;
}
示例4: createTrigger
import org.quartz.CronScheduleBuilder; //导入方法依赖的package包/类
private CronTrigger createTrigger(final String cronExpression) {
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
if (schedulerFacade.isMisfire()) {
cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionFireAndProceed();
} else {
cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionDoNothing();
}
return TriggerBuilder.newTrigger()
.withIdentity(triggerIdentity)
.withSchedule(cronScheduleBuilder).build();
}