/** * 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; } }
/** * 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; }
public Executor(Computer owner, int n) { super("Executor #"+n+" for "+owner.getDisplayName()); this.owner = owner; this.queue = Hudson.getInstance().getQueue(); this.number = n; }
/** * Returns true if the build is in the queue. */ @Override public boolean isInQueue() { return Hudson.getInstance().getQueue().contains(this); }
/** * 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; }
@Override public int computeQueueLength() { return Hudson.getInstance().getQueue().countBuildableItemsFor(Label.this); } };
/** * Returns the first queue item if the owner is scheduled for execution in the queue. */ public Item getQueuedItem() { return Hudson.getInstance().getQueue().getItem(owner); }
/** * Restores the queue content during the start up. */ @Initializer(after=JOB_LOADED) public static void init(Hudson h) { h.getQueue().load(); } }
@Override public int computeQueueLength() { return Hudson.getInstance().getQueue().countBuildableItemsFor(Label.this); } };
public Queue getQueue() { this.security.checkPermission(Hudson.ADMINISTER); return getHudson().getQueue(); } }
/** * Restores the queue content during the start up. */ @Initializer(after=JOB_LOADED) public static void init(Hudson h) { h.getQueue().load(); } }
/** * Called from queue.jelly. */ public HttpResponse doCancelQueue() throws IOException, ServletException { Hudson.getInstance().getQueue().cancel(this); return HttpResponses.forwardToPreviousPage(); }
/** * 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(); }
/** * 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; }
/** * Called from queue.jelly. */ public HttpResponse doClearQueue() throws IOException, ServletException { Hudson.getInstance().getQueue().clear(); return HttpResponses.forwardToPreviousPage(); }
/** * Called from queue.jelly. */ public HttpResponse doClearQueue() throws IOException, ServletException { Hudson.getInstance().getQueue().clear(); return HttpResponses.forwardToPreviousPage(); }
@CLIMethod(name = "cancel-quiet-down") public synchronized HttpRedirect doCancelQuietDown() { checkPermission(ADMINISTER); isQuietingDown = false; getQueue().scheduleMaintenance(); return new HttpRedirect("."); }
/** * Cancels a scheduled build. */ public void doCancelQueue(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(BUILD); Hudson.getInstance().getQueue().cancel(this); rsp.forwardToPreviousPage(req); }
@CLIMethod(name = "cancel-quiet-down") public synchronized HttpRedirect doCancelQuietDown() { checkPermission(ADMINISTER); isQuietingDown = false; getQueue().scheduleMaintenance(); return new HttpRedirect("."); }
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 }