hudson.model.queue
Class AbstractQueueTask

java.lang.Object
  extended by hudson.model.queue.AbstractQueueTask
All Implemented Interfaces:
ModelObject, SubTask, Queue.Task, ResourceActivity

public abstract class AbstractQueueTask
extends Object
implements Queue.Task

Abstract base class for Queue.Task to protect plugins from new additions to the interface.

Since:
1.360
Author:
Kohsuke Kawaguchi

Constructor Summary
AbstractQueueTask()
           
 
Method Summary
 CauseOfBlockage getCauseOfBlockage()
          If the execution of this task should be blocked for temporary reasons, this method returns a non-null object explaining why.
 Queue.Task getOwnerTask()
          Gets the Queue.Task that this subtask belongs to.
 Object getSameNodeConstraint()
          If a subset of SubTasks of a Queue.Task needs to be collocated with other SubTasks, those SubTasks should return the equal object here.
 Collection<? extends SubTask> getSubTasks()
          Obtains the SubTasks that constitute this task.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getFullDisplayName, getName, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlocked
 
Methods inherited from interface hudson.model.ModelObject
getDisplayName
 
Methods inherited from interface hudson.model.queue.SubTask
createExecutable, getAssignedLabel, getEstimatedDuration, getLastBuiltOn
 
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
 

Constructor Detail

AbstractQueueTask

public AbstractQueueTask()
Method Detail

getSubTasks

public Collection<? extends SubTask> getSubTasks()
Description copied from interface: Queue.Task
Obtains the SubTasks 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.

Specified by:
getSubTasks in interface Queue.Task

getOwnerTask

public final Queue.Task getOwnerTask()
Description copied from interface: SubTask
Gets the Queue.Task that this subtask belongs to.

Specified by:
getOwnerTask in interface SubTask

isConcurrentBuild

public boolean isConcurrentBuild()
Description copied from interface: Queue.Task
True if the task allows concurrent builds, where the same Queue.TransientTask is executed by multiple executors concurrently on the same or different nodes.

Specified by:
isConcurrentBuild in interface Queue.Task

getCauseOfBlockage

public CauseOfBlockage getCauseOfBlockage()
Description copied from interface: Queue.Task
If the execution of this task should be blocked for temporary reasons, this method returns a non-null object explaining why.

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().

Specified by:
getCauseOfBlockage in interface Queue.Task

getSameNodeConstraint

public Object getSameNodeConstraint()
Description copied from interface: SubTask
If a subset of SubTasks of a Queue.Task needs to be collocated with other SubTasks, those SubTasks should return the equal object here. If null, the execution unit isn't under a colocation constraint.

Specified by:
getSameNodeConstraint in interface SubTask


Copyright © 2004-2013. All Rights Reserved.