hudson.model.Hudson.getQueue()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(210)

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

Hudson.getQueue介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
   * Returns the queue item if the owner is scheduled for execution in the
   * queue, in REVERSE ORDER
   */
  public List<Item> getQueuedItems() {
    List<Item> list = new ArrayList<Item>(Hudson.getInstance().getQueue().getItems(owner));
    Collections.reverse(list);
    return list;
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Returns the time when this computer first became in demand.
 */
public final long getDemandStartMilliseconds() {
  long firstDemand = Long.MAX_VALUE;
  for (Queue.BuildableItem item : Hudson.getInstance().getQueue().getBuildableItems(this)) {
    firstDemand = Math.min(item.buildableStartMilliseconds, firstDemand);
  }
  return firstDemand;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public Executor(Computer owner, int n) {
  super("Executor #"+n+" for "+owner.getDisplayName());
  this.owner = owner;
  this.queue = Hudson.getInstance().getQueue();
  this.number = n;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns true if the build is in the queue.
 */
@Override
public boolean isInQueue() {
  return Hudson.getInstance().getQueue().contains(this);
}

代码示例来源:origin: org.jvnet.hudson.main/maven-plugin

/**
 * Returns the {@link MavenModule}s that are in the queue.
 */
public List<Queue.Item> getQueueItems() {
  List<Queue.Item> r = new ArrayList<hudson.model.Queue.Item>();
  for( Queue.Item item : Hudson.getInstance().getQueue().getItems() ) {
    Task t = item.task;
    if((t instanceof MavenModule && ((MavenModule)t).getParent()==this) || t ==this)
      r.add(item);
  }
  return r;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
  public int computeQueueLength() {
    return Hudson.getInstance().getQueue().countBuildableItemsFor(Label.this);
  }
};

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns the first queue item if the owner is scheduled for execution in the queue.
 */
public Item getQueuedItem() {
  return Hudson.getInstance().getQueue().getItem(owner);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
   * Restores the queue content during the start up.
   */
  @Initializer(after=JOB_LOADED)
  public static void init(Hudson h) {
    h.getQueue().load();
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
  public int computeQueueLength() {
    return Hudson.getInstance().getQueue().countBuildableItemsFor(Label.this);
  }
};

代码示例来源:origin: org.eclipse.hudson/hudson-service

public Queue getQueue() {
    this.security.checkPermission(Hudson.ADMINISTER);
    return getHudson().getQueue();
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
   * Restores the queue content during the start up.
   */
  @Initializer(after=JOB_LOADED)
  public static void init(Hudson h) {
    h.getQueue().load();
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Called from queue.jelly.
 */
public HttpResponse doCancelQueue() throws IOException, ServletException {
  Hudson.getInstance().getQueue().cancel(this);
  return HttpResponses.forwardToPreviousPage();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Marks the build as disabled.
 */
public void makeDisabled(boolean b) throws IOException {
  if(disabled==b)     return; // noop
  this.disabled = b;
  if(b)
    Hudson.getInstance().getQueue().cancel(this);
  save();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-harness

/**
 * Returns true if Hudson is building something or going to build something.
 */
protected boolean isSomethingHappening() {
  if (!hudson.getQueue().isEmpty())
    return true;
  for (Computer n : hudson.getComputers())
    if (!n.isIdle())
      return true;
  return false;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Called from queue.jelly.
 */
public HttpResponse doClearQueue() throws IOException, ServletException {
  Hudson.getInstance().getQueue().clear();
  return HttpResponses.forwardToPreviousPage();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Called from queue.jelly.
 */
public HttpResponse doClearQueue() throws IOException, ServletException {
  Hudson.getInstance().getQueue().clear();
  return HttpResponses.forwardToPreviousPage();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@CLIMethod(name = "cancel-quiet-down")
public synchronized HttpRedirect doCancelQuietDown() {
  checkPermission(ADMINISTER);
  isQuietingDown = false;
  getQueue().scheduleMaintenance();
  return new HttpRedirect(".");
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Cancels a scheduled build.
 */
public void doCancelQueue(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  checkPermission(BUILD);
  Hudson.getInstance().getQueue().cancel(this);
  rsp.forwardToPreviousPage(req);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@CLIMethod(name = "cancel-quiet-down")
public synchronized HttpRedirect doCancelQuietDown() {
  checkPermission(ADMINISTER);
  isQuietingDown = false;
  getQueue().scheduleMaintenance();
  return new HttpRedirect(".");
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public String getTooltip() {
  MatrixRun r = getRun();
  if (r != null) {
    return r.getIconColor().getDescription();
  }
  Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination));
  if (item != null) {
    return item.getWhy();
  }
  return null;    // fall back
}

相关文章

Hudson类方法