當前位置: 首頁>>代碼示例>>Java>>正文


Java CronScheduleBuilder.withMisfireHandlingInstructionDoNothing方法代碼示例

本文整理匯總了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;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:22,代碼來源:CronTriggerImpl.java

示例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();
}
 
開發者ID:taboola,項目名稱:taboola-cronyx,代碼行數:18,代碼來源:CronConverter.java

示例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;
}
 
開發者ID:motech,項目名稱:motech,代碼行數:17,代碼來源:MotechSchedulerServiceImpl.java

示例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();
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:12,代碼來源:JobScheduleController.java


注:本文中的org.quartz.CronScheduleBuilder.withMisfireHandlingInstructionDoNothing方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。