|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Queue.Task
Task whose execution is controlled by the queue.
Value equality
of Queue.TransientTask
s is used
to collapse two tasks into one. This is used to avoid infinite
queue backlog.
Pending Queue.TransientTask
s are persisted when Hudson shuts down, so
it needs to be persistable via XStream. To create a non-persisted
transient Task, extend Queue.TransientTask
marker interface.
Plugins are encouraged to extend from AbstractQueueTask
instead of implementing this interface directly, to maintain
compatibility with future changes to this interface.
For historical reasons, Queue.TransientTask
object by itself
also represents the "primary" sub-task (and as implied by this
design, a Queue.TransientTask
must have at least one sub-task.)
Most of the time, the primary subtask is the only sub task.
Method Summary | |
---|---|
void |
checkAbortPermission()
Checks the permission to see if the current user can abort this executable. |
CauseOfBlockage |
getCauseOfBlockage()
If the execution of this task should be blocked for temporary reasons, this method returns a non-null object explaining why. |
String |
getFullDisplayName()
|
String |
getName()
Unique name of this task. |
Collection<? extends SubTask> |
getSubTasks()
Obtains the SubTask s that constitute this task. |
String |
getUrl()
Returns the URL of this task relative to the context root of the application. |
String |
getWhyBlocked()
Deprecated. as of 1.330 Use CauseOfBlockage.getShortDescription() instead. |
boolean |
hasAbortPermission()
Works just like checkAbortPermission() except it indicates the status by a return value,
instead of exception. |
boolean |
isBuildBlocked()
Returns true if the execution should be blocked for temporary reasons. |
boolean |
isConcurrentBuild()
True if the task allows concurrent builds, where the same Queue.TransientTask is executed
by multiple executors concurrently on the same or different nodes. |
Methods inherited from interface hudson.model.ModelObject |
---|
getDisplayName |
Methods inherited from interface hudson.model.queue.SubTask |
---|
createExecutable, getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerTask, getSameNodeConstraint |
Methods inherited from interface hudson.model.ResourceActivity |
---|
getDisplayName, getResourceList |
Method Detail |
---|
boolean isBuildBlocked()
Short-hand for getCauseOfBlockage()!=null
.
String getWhyBlocked()
CauseOfBlockage.getShortDescription()
instead.
CauseOfBlockage getCauseOfBlockage()
Otherwise this method returns null, indicating that the build can proceed right away.
This can be used to define mutual exclusion that goes beyond
ResourceActivity.getResourceList()
.
String getName()
This method is no longer used, left here for compatibility. Just return ModelObject.getDisplayName()
.
String getFullDisplayName()
Item.getFullDisplayName()
void checkAbortPermission()
org.acegisecurity.AccessDeniedException
- if the permission is not granted.boolean hasAbortPermission()
checkAbortPermission()
except it indicates the status by a return value,
instead of exception.
String getUrl()
When the user clicks an item in the queue, this is the page where the user is taken to. Hudson expects the current instance to be bound to the URL returned by this method.
boolean isConcurrentBuild()
Queue.TransientTask
is executed
by multiple executors concurrently on the same or different nodes.
Collection<? extends SubTask> getSubTasks()
SubTask
s that constitute this task.
The collection returned by this method must also contain the primary SubTask
represented by this Queue.TransientTask
object itself as the first element.
The returned value is read-only.
At least size 1.
Since this is a newly added method, the invocation may results in AbstractMethodError
.
Use Tasks#getSubTasksOf(Task)
that avoids this.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |