public abstract class AbstractQueueTask extends Object implements Queue.Task
Queue.Task
to protect plugins
from new additions to the interface.
Plugins are encouraged to implement AccessControlled
otherwise
the tasks will be hidden from display in the queue.
Constructor and Description |
---|
AbstractQueueTask() |
Modifier and Type | Method and Description |
---|---|
CauseOfBlockage |
getCauseOfBlockage()
If the execution of this task should be blocked for temporary reasons,
this method returns a non-null object explaining why.
|
org.acegisecurity.Authentication |
getDefaultAuthentication()
This default implementation is the historical behaviour, but this is no longer desirable.
|
org.acegisecurity.Authentication |
getDefaultAuthentication(Queue.Item item)
This method allows the task to provide the default fallback authentication object to be used
when
QueueItemAuthenticator fails to authenticate the build. |
Queue.Task |
getOwnerTask()
Gets the
Queue.Task that this subtask belongs to. |
Object |
getSameNodeConstraint()
If a subset of
SubTask s of a Queue.Task needs to be collocated with other SubTask s,
those SubTask s should return the equal object here. |
Collection<? extends SubTask> |
getSubTasks()
Obtains the
SubTask s that constitute this task. |
boolean |
isConcurrentBuild()
True if the task allows concurrent builds, where the same
Queue.Task is executed
by multiple executors concurrently on the same or different nodes. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkAbortPermission, getFullDisplayName, getName, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlocked
getDisplayName
createExecutable, getAssignedLabel, getEstimatedDuration, getLastBuiltOn
getDisplayName, getResourceList
public Collection<? extends SubTask> getSubTasks()
Queue.Task
SubTask
s that constitute this task.
The collection returned by this method must also contain the primary SubTask
represented by this Queue.Task
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(Queue.Task)
that avoids this.
getSubTasks
in interface Queue.Task
public final Queue.Task getOwnerTask()
SubTask
Queue.Task
that this subtask belongs to.getOwnerTask
in interface SubTask
public boolean isConcurrentBuild()
Queue.Task
Queue.Task
is executed
by multiple executors concurrently on the same or different nodes.isConcurrentBuild
in interface Queue.Task
public CauseOfBlockage getCauseOfBlockage()
Queue.Task
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()
.
getCauseOfBlockage
in interface Queue.Task
public Object getSameNodeConstraint()
SubTask
SubTask
s of a Queue.Task
needs to be collocated with other SubTask
s,
those SubTask
s should return the equal object here. If null, the execution unit isn't under a
colocation constraint.getSameNodeConstraint
in interface SubTask
@Nonnull public org.acegisecurity.Authentication getDefaultAuthentication()
Queue.Task.getDefaultAuthentication()
for the contract.getDefaultAuthentication
in interface Queue.Task
QueueItemAuthenticator
,
Tasks.getDefaultAuthenticationOf(Queue.Task)
@Nonnull public org.acegisecurity.Authentication getDefaultAuthentication(Queue.Item item)
Queue.Task
QueueItemAuthenticator
fails to authenticate the build.
When the task execution touches other objects inside Jenkins, the access control is performed
based on whether this Authentication
is allowed to use them.
This method was added to an interface after it was created, so plugins built against
older versions of Jenkins may not have this method implemented. Called private method _getDefaultAuthenticationOf(Task) on Tasks
to avoid AbstractMethodError
.
getDefaultAuthentication
in interface Queue.Task
QueueItemAuthenticator
,
Tasks.getDefaultAuthenticationOf(Queue.Task, Queue.Item)
Copyright © 2017. All rights reserved.