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


Java Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY属性代码示例

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


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

示例1: updateAfterMisfire

/**
 * <p>
 * Updates the <code>CronTrigger</code>'s state based on the
 * MISFIRE_INSTRUCTION_XXX that was selected when the <code>CronTrigger</code>
 * was created.
 * </p>
 * 
 * <p>
 * If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY,
 * then the following scheme will be used: <br>
 * <ul>
 * <li>The instruction will be interpreted as <code>MISFIRE_INSTRUCTION_FIRE_ONCE_NOW</code>
 * </ul>
 * </p>
 */
@Override
public void updateAfterMisfire(org.quartz.Calendar cal) {
    int instr = getMisfireInstruction();

    if(instr == Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY)
        return;

    if (instr == MISFIRE_INSTRUCTION_SMART_POLICY) {
        instr = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW;
    }

    if (instr == MISFIRE_INSTRUCTION_DO_NOTHING) {
        Date newFireTime = getFireTimeAfter(new Date());
        while (newFireTime != null && cal != null
                && !cal.isTimeIncluded(newFireTime.getTime())) {
            newFireTime = getFireTimeAfter(newFireTime);
        }
        setNextFireTime(newFireTime);
    } else if (instr == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) {
        setNextFireTime(new Date());
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:CronTriggerImpl.java

示例2: applyMisfire

boolean applyMisfire(TriggerWrapper tw) throws JobPersistenceException {
  long misfireTime = System.currentTimeMillis();
  if (getMisfireThreshold() > 0) {
    misfireTime -= getMisfireThreshold();
  }

  Date tnft = tw.getNextFireTime();
  if (tnft == null || tnft.getTime() > misfireTime
      || tw.getMisfireInstruction() == Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY) { return false; }

  Calendar cal = null;
  if (tw.getCalendarName() != null) {
    cal = retrieveCalendar(tw.getCalendarName());
  }

  signaler.notifyTriggerListenersMisfired(tw.getTriggerClone());

  tw.updateAfterMisfire(cal, triggerFacade);

  if (tw.getNextFireTime() == null) {
    tw.setState(TriggerState.COMPLETE, terracottaClientId, triggerFacade);
    signaler.notifySchedulerListenersFinalized(tw.getTriggerClone());
    timeTriggers.remove(tw);
  } else if (tnft.equals(tw.getNextFireTime())) { return false; }

  return true;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:DefaultClusteredJobStore.java

示例3: updateAfterMisfire

/**
 * <p>
 * Updates the <code>DateIntervalTrigger</code>'s state based on the
 * MISFIRE_INSTRUCTION_XXX that was selected when the <code>DateIntervalTrigger</code>
 * was created.
 * </p>
 * 
 * <p>
 * If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY,
 * then the following scheme will be used: <br>
 * <ul>
 * <li>The instruction will be interpreted as <code>MISFIRE_INSTRUCTION_FIRE_ONCE_NOW</code>
 * </ul>
 * </p>
 */
@Override
public void updateAfterMisfire(org.quartz.Calendar cal) {
    int instr = getMisfireInstruction();

    if(instr == Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY)
        return;

    if (instr == MISFIRE_INSTRUCTION_SMART_POLICY) {
        instr = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW;
    }

    if (instr == MISFIRE_INSTRUCTION_DO_NOTHING) {
        Date newFireTime = getFireTimeAfter(new Date());
        while (newFireTime != null && cal != null
                && !cal.isTimeIncluded(newFireTime.getTime())) {
            newFireTime = getFireTimeAfter(newFireTime);
        }
        setNextFireTime(newFireTime);
    } else if (instr == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) { 
        // fire once now...
        setNextFireTime(new Date());
        // the new fire time afterward will magically preserve the original  
        // time of day for firing for day/week/month interval triggers, 
        // because of the way getFireTimeAfter() works - in its always restarting
        // computation from the start time.
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:42,代码来源:CalendarIntervalTriggerImpl.java

示例4: applyMisfire

protected boolean applyMisfire(TriggerWrapper tw) {

        long misfireTime = System.currentTimeMillis();
        if (getMisfireThreshold() > 0) {
            misfireTime -= getMisfireThreshold();
        }

        Date tnft = tw.trigger.getNextFireTime();
        if (tnft == null || tnft.getTime() > misfireTime 
                || tw.trigger.getMisfireInstruction() == Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY) { 
            return false; 
        }

        Calendar cal = null;
        if (tw.trigger.getCalendarName() != null) {
            cal = retrieveCalendar(tw.trigger.getCalendarName());
        }

        signaler.notifyTriggerListenersMisfired((OperableTrigger)tw.trigger.clone());

        tw.trigger.updateAfterMisfire(cal);

        if (tw.trigger.getNextFireTime() == null) {
            tw.state = TriggerWrapper.STATE_COMPLETE;
            signaler.notifySchedulerListenersFinalized(tw.trigger);
            synchronized (lock) {
                timeTriggers.remove(tw);
            }
        } else if (tnft.equals(tw.trigger.getNextFireTime())) {
            return false;
        }

        return true;
    }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:34,代码来源:RAMJobStore.java

示例5: updateAfterMisfire

/**
 * <p>
 * Updates the <code>DailyTimeIntervalTrigger</code>'s state based on the
 * MISFIRE_INSTRUCTION_XXX that was selected when the <code>DailyTimeIntervalTrigger</code>
 * was created.
 * </p>
 * 
 * <p>
 * If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY,
 * then the following scheme will be used: <br>
 * <ul>
 * <li>The instruction will be interpreted as <code>MISFIRE_INSTRUCTION_FIRE_ONCE_NOW</code>
 * </ul>
 * </p>
 */
@Override
public void updateAfterMisfire(org.quartz.Calendar cal) {
    int instr = getMisfireInstruction();

    if(instr == Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY)
        return;

    if (instr == MISFIRE_INSTRUCTION_SMART_POLICY) {
        instr = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW;
    }

    if (instr == MISFIRE_INSTRUCTION_DO_NOTHING) {
        Date newFireTime = getFireTimeAfter(new Date());
        while (newFireTime != null && cal != null
                && !cal.isTimeIncluded(newFireTime.getTime())) {
            newFireTime = getFireTimeAfter(newFireTime);
        }
        setNextFireTime(newFireTime);
    } else if (instr == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) { 
        // fire once now...
        setNextFireTime(new Date());
        // the new fire time afterward will magically preserve the original  
        // time of day for firing for day/week/month interval triggers, 
        // because of the way getFireTimeAfter() works - in its always restarting
        // computation from the start time.
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:42,代码来源:DailyTimeIntervalTriggerImpl.java


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