org.quartz.Trigger.getCalendarName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.quartz.Trigger.getCalendarName()方法的一些代码示例,展示了Trigger.getCalendarName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trigger.getCalendarName()方法的具体详情如下:
包路径:org.quartz.Trigger
类名称:Trigger
方法名:getCalendarName

Trigger.getCalendarName介绍

[英]Get the name of the Calendar associated with this Trigger.
[中]获取与此触发器关联的Calendar的名称。

代码示例

代码示例来源:origin: quartz-scheduler/quartz

if (trigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(trigger.getCalendarName());
  if(cal == null) {
    throw new SchedulerException(
      "Calendar '" + trigger.getCalendarName() + "' not found for trigger: " + trigger.getKey());

代码示例来源:origin: quartz-scheduler/quartz

if (trigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(trigger.getCalendarName());
  if(cal == null) {
    throw new SchedulerException(
      "Calendar '" + trigger.getCalendarName() + "' not found for trigger: " + trigger.getKey());

代码示例来源:origin: quartz-scheduler/quartz

if (trigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(trigger.getCalendarName());
  if(cal == null) {
    throw new SchedulerException(
      "Calendar not found: " + trigger.getCalendarName());

代码示例来源:origin: quartz-scheduler/quartz

if (trigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(trigger.getCalendarName());
  if(cal == null) {
    throw new SchedulerException(
      "Calendar not found: " + trigger.getCalendarName());

代码示例来源:origin: quartz-scheduler/quartz

if (newTrigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(
      newTrigger.getCalendarName());

代码示例来源:origin: quartz-scheduler/quartz

if (newTrigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(
      newTrigger.getCalendarName());

代码示例来源:origin: quartz-scheduler/quartz

/**
 * @return composite data
 */
public static CompositeData toCompositeData(JobExecutionContext jec)
    throws SchedulerException {
  try {
    return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
        new Object[] {
            jec.getScheduler().getSchedulerName(),
            jec.getTrigger().getKey().getName(),
            jec.getTrigger().getKey().getGroup(),
            jec.getJobDetail().getKey().getName(),
            jec.getJobDetail().getKey().getGroup(),
            JobDataMapSupport.toTabularData(jec
                .getMergedJobDataMap()),
            jec.getTrigger().getCalendarName(),
            jec.isRecovering(),
            jec.getRefireCount(),
            jec.getFireTime(), jec.getScheduledFireTime(),
            jec.getPreviousFireTime(), jec.getNextFireTime(),
            jec.getJobRunTime(),
            jec.getFireInstanceId() });
  } catch (OpenDataException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: quartz-scheduler/quartz

public static CompositeData toCompositeData(Trigger trigger) {
  try {
    return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
        new Object[] {
            trigger.getKey().getName(),
            trigger.getKey().getGroup(),
            trigger.getJobKey().getName(),
            trigger.getJobKey().getGroup(),
            trigger.getDescription(),
            JobDataMapSupport.toTabularData(trigger
                .getJobDataMap()),
            trigger.getCalendarName(),
            ((OperableTrigger)trigger).getFireInstanceId(),
            trigger.getMisfireInstruction(),
            trigger.getPriority(), trigger.getStartTime(),
            trigger.getEndTime(), trigger.getNextFireTime(),
            trigger.getPreviousFireTime(),
            trigger.getFinalFireTime() });
  } catch (OpenDataException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: quartz-scheduler/quartz

if (trigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(trigger.getCalendarName());

代码示例来源:origin: quartz-scheduler/quartz

if (trigger.getCalendarName() != null) {
  cal = resources.getJobStore().retrieveCalendar(trigger.getCalendarName());

代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz

protected ArrayList getTriggerWrappersForCalendar(String calName) {
  ArrayList trigList = new ArrayList();
  synchronized (triggerLock) {
    for (int i = 0; i < triggers.size(); i++) {
      TriggerWrapper tw = (TriggerWrapper) triggers.get(i);
      String tcalName = tw.getTrigger().getCalendarName();
      if (tcalName != null && tcalName.equals(calName)) {
        trigList.add(tw);
      }
    }
  }
  return trigList;
}

代码示例来源:origin: quartz/quartz-all

protected ArrayList getTriggerWrappersForCalendar(String calName) {
  ArrayList trigList = new ArrayList();
  synchronized (triggerLock) {
    for (int i = 0; i < triggers.size(); i++) {
      TriggerWrapper tw = (TriggerWrapper) triggers.get(i);
      String tcalName = tw.getTrigger().getCalendarName();
      if (tcalName != null && tcalName.equals(calName)) {
        trigList.add(tw);
      }
    }
  }
  return trigList;
}

代码示例来源:origin: quartz/quartz-all

/**
 * <p>
 * Return a simple string representation of this object.
 * </p>
 */
public String toString() {
  return "Trigger '" + getFullName() + "':  triggerClass: '"
      + getClass().getName() + " isVolatile: " + isVolatile()
      + " calendar: '" + getCalendarName() + "' misfireInstruction: "
      + getMisfireInstruction() + " nextFireTime: " + getNextFireTime();
}

代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * <p>
 * Return a simple string representation of this object.
 * </p>
 */
public String toString() {
  return "Trigger '" + getFullName() + "':  triggerClass: '"
      + getClass().getName() + " isVolatile: " + isVolatile()
      + " calendar: '" + getCalendarName() + "' misfireInstruction: "
      + getMisfireInstruction() + " nextFireTime: " + getNextFireTime();
}

代码示例来源:origin: myschedule/myschedule-quartz-extra

/**
 * Get a list of next fire time dates up to maxCount time. If next fire time needed
 * before maxCount, then there should be a null object in the last element of the list.
 */
public List<Date> getNextFireTimesWithCalendar(Trigger trigger, Date startTime, int maxCount) {
  List<Date> dates = getNextFireTimes(trigger, startTime, maxCount);
  String calName = trigger.getCalendarName();
  if (calName == null) {
    return dates;
  }
  // Else check if dates has excluded by calendar or not.
  Calendar cal = getCalendar(calName);
  List<Date> result = new ArrayList<Date>();
  for (Date dt : dates) {
    if (cal.isTimeIncluded(dt.getTime())) {
      result.add(dt);
    }
  }
  return result;
}

代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz

private void doUpdateOfMisfiredTrigger(Connection conn, SchedulingContext ctxt, Trigger trig, boolean forceState, String newStateIfNotComplete, boolean recovering) throws JobPersistenceException {
  Calendar cal = null;
  if (trig.getCalendarName() != null) {
    cal = retrieveCalendar(conn, ctxt, trig.getCalendarName());
  }
  signaler.notifyTriggerListenersMisfired(trig);
  trig.updateAfterMisfire(cal);
  if (trig.getNextFireTime() == null) {
    storeTrigger(conn, ctxt, trig,
      null, true, STATE_COMPLETE, forceState, recovering);
  } else {
    storeTrigger(conn, ctxt, trig, null, true, newStateIfNotComplete,
        forceState, false);
  }
}

代码示例来源:origin: quartz/quartz-all

private void doUpdateOfMisfiredTrigger(Connection conn, SchedulingContext ctxt, Trigger trig, boolean forceState, String newStateIfNotComplete, boolean recovering) throws JobPersistenceException {
  Calendar cal = null;
  if (trig.getCalendarName() != null) {
    cal = retrieveCalendar(conn, ctxt, trig.getCalendarName());
  }
  signaler.notifyTriggerListenersMisfired(trig);
  trig.updateAfterMisfire(cal);
  if (trig.getNextFireTime() == null) {
    storeTrigger(conn, ctxt, trig,
      null, true, STATE_COMPLETE, forceState, recovering);
  } else {
    storeTrigger(conn, ctxt, trig, null, true, newStateIfNotComplete,
        forceState, false);
  }
}

代码示例来源:origin: quartz/quartz-all

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) { 
    return false; 
  }
  Calendar cal = null;
  if (tw.trigger.getCalendarName() != null) {
    cal = retrieveCalendar(null, tw.trigger.getCalendarName());
  }
  signaler.notifyTriggerListenersMisfired((Trigger)tw.trigger.clone());
  tw.trigger.updateAfterMisfire(cal);
  if (tw.trigger.getNextFireTime() == null) {
    tw.state = TriggerWrapper.STATE_COMPLETE;
    signaler.notifySchedulerListenersFinalized(tw.trigger);
    synchronized (triggerLock) {
      timeTriggers.remove(tw);
    }
  } else if (tnft.equals(tw.trigger.getNextFireTime())) {
    return false;
  }
  return true;
}

代码示例来源:origin: nkcoder/quartz-explained

/**
 * @return composite data
 */
public static CompositeData toCompositeData(JobExecutionContext jec)
    throws SchedulerException {
  try {
    return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
        new Object[] {
            jec.getScheduler().getSchedulerName(),
            jec.getTrigger().getKey().getName(),
            jec.getTrigger().getKey().getGroup(),
            jec.getJobDetail().getKey().getName(),
            jec.getJobDetail().getKey().getGroup(),
            JobDataMapSupport.toTabularData(jec
                .getMergedJobDataMap()),
            jec.getTrigger().getCalendarName(),
            jec.isRecovering(),
            jec.getRefireCount(),
            jec.getFireTime(), jec.getScheduledFireTime(),
            jec.getPreviousFireTime(), jec.getNextFireTime(),
            jec.getJobRunTime(),
            jec.getFireInstanceId() });
  } catch (OpenDataException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: nkcoder/quartz-explained

public static CompositeData toCompositeData(Trigger trigger) {
  try {
    return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
        new Object[] {
            trigger.getKey().getName(),
            trigger.getKey().getGroup(),
            trigger.getJobKey().getName(),
            trigger.getJobKey().getGroup(),
            trigger.getDescription(),
            JobDataMapSupport.toTabularData(trigger
                .getJobDataMap()),
            trigger.getCalendarName(),
            ((OperableTrigger)trigger).getFireInstanceId(),
            trigger.getMisfireInstruction(),
            trigger.getPriority(), trigger.getStartTime(),
            trigger.getEndTime(), trigger.getNextFireTime(),
            trigger.getPreviousFireTime(),
            trigger.getFinalFireTime() });
  } catch (OpenDataException e) {
    throw new RuntimeException(e);
  }
}

相关文章