提交 c7a5a555 编写于 作者: K kohsuke

added additional methods to expose the pending state.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@32533 71c3de6d-444a-0410-be80-ed276b4c234a
上级 04ec9159
......@@ -141,7 +141,8 @@ public class Queue extends ResourceController implements Saveable {
private final ItemList<BuildableItem> buildables = new ItemList<BuildableItem>();
/**
* {@link Task}s that are being handed over to the executor.
* {@link Task}s that are being handed over to the executor, but execution
* has not started yet.
*/
private final ItemList<BuildableItem> pendings = new ItemList<BuildableItem>();
......@@ -612,6 +613,23 @@ public class Queue extends ResourceController implements Saveable {
return r;
}
/**
* Gets the snapshot of all {@link BuildableItem}s.
*/
public synchronized List<BuildableItem> getPendingItems() {
return new ArrayList<BuildableItem>(pendings.values());
}
/**
* Is the given task currently pending execution?
*/
public synchronized boolean isPending(Task t) {
for (BuildableItem i : pendings)
if (i.task.equals(t))
return true;
return false;
}
/**
* How many {@link BuildableItem}s are assigned for the given label?
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册