From da0a646702dcdbed43d1e5326ea17102e90e42ab Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sat, 23 Jun 2007 15:39:33 +0000 Subject: [PATCH] doc improvement. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3516 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Queue.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 1fd5b29e67..a2614ed948 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -165,9 +165,25 @@ public class Queue { /** * Schedules a new build with a custom quiet period. * + *

+ * Left for backward compatibility with <1.114. + * * @since 1.105 */ public synchronized boolean add( AbstractProject p, int quietPeriod ) { + return add((Task)p,quietPeriod); + } + + /** + * Schedules an execution of a task. + * + * @param quietPeriod + * Number of seconds that the task will be placed in queue. + * Useful when the same task is likely scheduled for multiple + * times. + * @since 1.114 + */ + public synchronized boolean add( Task p, int quietPeriod ) { if(contains(p)) return false; // no double queueing @@ -472,6 +488,13 @@ public class Queue { } } + /** + * Task whose execution is controlled by the queue. + *

+ * {@link #equals(Object) Value equality} of {@link Task}s is used + * to collapse two tasks into one. This is used to avoid infinite + * queue backlog. + */ public interface Task { /** * If this task needs to be run on a node with a particular label,