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

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

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

Trigger.getPriority介绍

[英]The priority of a Trigger acts as a tiebreaker such that if two Triggers have the same scheduled fire time, then the one with the higher priority will get first access to a worker thread.

If not explicitly set, the default value is 5.
[中]Trigger的优先级起到了分阶段的作用,因此,如果两个Trigger具有相同的计划启动时间,那么优先级较高的一个将首先访问工作线程。
如果未明确设置,默认值为[$2$]。

代码示例

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

public int compare(Trigger t1, Trigger t2) {
    return compare(t1.getNextFireTime(), t1.getPriority(), t1.getKey(), t2.getNextFireTime(), t2.getPriority(), t2.getKey());
  }
}

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

public int compare(Trigger t1, Trigger t2) {
    return compare(t1.getNextFireTime(), t1.getPriority(), t1.getKey(), t2.getNextFireTime(), t2.getPriority(), t2.getKey());
  }
}

代码示例来源: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: com.opensymphony.quartz/com.springsource.org.quartz

public int compare(Object obj1, Object obj2) {
  TriggerWrapper trig1 = (TriggerWrapper) obj1;
  TriggerWrapper trig2 = (TriggerWrapper) obj2;
  int comp = trig1.trigger.compareTo(trig2.trigger);
  if (comp != 0) {
    return comp;
  }
  comp = trig2.trigger.getPriority() - trig1.trigger.getPriority();
  if (comp != 0) {
    return comp;
  }
  
  return trig1.trigger.getFullName().compareTo(trig2.trigger.getFullName());
}

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

public int compare(Object obj1, Object obj2) {
  TriggerWrapper trig1 = (TriggerWrapper) obj1;
  TriggerWrapper trig2 = (TriggerWrapper) obj2;
  int comp = trig1.trigger.compareTo(trig2.trigger);
  if (comp != 0) {
    return comp;
  }
  comp = trig2.trigger.getPriority() - trig1.trigger.getPriority();
  if (comp != 0) {
    return comp;
  }
  
  return trig1.trigger.getFullName().compareTo(trig2.trigger.getFullName());
}

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

ps.setInt(14, trigger.getMisfireInstruction());
ps.setBinaryStream(15, bais, len);
ps.setInt(16, trigger.getPriority());

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

ps.setInt(14, trigger.getMisfireInstruction());
ps.setBinaryStream(15, bais, len);
ps.setInt(16, trigger.getPriority());

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

setBoolean(ps, 11, false);
ps.setInt(12, trigger.getPriority());

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

ps.setInt(12, trigger.getMisfireInstruction());
ps.setInt(13, trigger.getPriority());
ps.setBinaryStream(14, bais, len);
ps.setString(15, trigger.getName());

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

setBoolean(ps, 11, false);
ps.setInt(12, trigger.getPriority());

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

ps.setInt(12, trigger.getMisfireInstruction());
ps.setInt(13, trigger.getPriority());
ps.setBinaryStream(14, bais, len);
ps.setString(15, trigger.getName());

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

ps.setInt(14, trigger.getMisfireInstruction());
setBytes(ps, 15, baos);
ps.setInt(16, trigger.getPriority());

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

ps.setInt(14, trigger.getMisfireInstruction());
setBytes(ps, 15, baos);
ps.setInt(16, trigger.getPriority());

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

ps.setString(11, trigger.getCalendarName());
ps.setInt(12, trigger.getMisfireInstruction());
ps.setInt(13, trigger.getPriority());

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

ps.setString(11, trigger.getCalendarName());
ps.setInt(12, trigger.getMisfireInstruction());
ps.setInt(13, trigger.getPriority());

代码示例来源:origin: org.finra.herd/herd-service

"misfireInstruction: %s, nextFireTime: %s, previousFireTime: %s, priority: %s, startTime: %s", trigger.getCalendarName(), trigger.getDescription(),
trigger.getEndTime(), trigger.getFinalFireTime(), trigger.getJobKey(), trigger.getKey(), trigger.getMisfireInstruction(), trigger.getNextFireTime(),
trigger.getPreviousFireTime(), trigger.getPriority(), trigger.getStartTime()));

代码示例来源:origin: FINRAOS/herd

"misfireInstruction: %s, nextFireTime: %s, previousFireTime: %s, priority: %s, startTime: %s", trigger.getCalendarName(), trigger.getDescription(),
trigger.getEndTime(), trigger.getFinalFireTime(), trigger.getJobKey(), trigger.getKey(), trigger.getMisfireInstruction(), trigger.getNextFireTime(),
trigger.getPreviousFireTime(), trigger.getPriority(), trigger.getStartTime()));

代码示例来源:origin: org.seedstack.seed/seed-scheduling-support

SchedulingContextImpl(JobExecutionContext context) {
  taskName = context.getJobDetail().getKey().getName();
  storeDurably = context.getJobDetail().isDurable();
  requestRecovery = context.getJobDetail().requestsRecovery();
  scheduledFireDate = context.getScheduledFireTime();
  currentFireDate = context.getFireTime();
  previousFireDate = context.getPreviousFireTime();
  nextFireDate = context.getNextFireTime();
  taskRuntime = context.getJobRunTime();
  triggerRefireCount = context.getRefireCount();
  triggerEndDate = context.getTrigger().getEndTime();
  triggerFinalFireDate = context.getTrigger().getFinalFireTime();
  triggerName = context.getTrigger().getKey().getName();
  triggerStartDate = context.getTrigger().getStartTime();
  triggerPriority = context.getTrigger().getPriority();
}

代码示例来源: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);
  }
}

相关文章