hudson.model.queue
Class AbstractSubTask

java.lang.Object
  extended by hudson.model.queue.AbstractSubTask
All Implemented Interfaces:
SubTask, ResourceActivity

public abstract class AbstractSubTask
extends Object
implements SubTask

Partial default implementation of SubTask to avoid AbstractMethodError with future additions to SubTask.

Author:
Kohsuke Kawaguchi

Constructor Summary
AbstractSubTask()
           
 
Method Summary
 Label getAssignedLabel()
          If this task needs to be run on a node with a particular label, return that Label.
 long getEstimatedDuration()
          Estimate of how long will it take to execute this task.
 Node getLastBuiltOn()
          If the previous execution of this task run on a certain node and this task prefers to run on the same node, return that.
 ResourceList getResourceList()
          Gets the list of Resources that this task requires.
 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.
 
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.SubTask
createExecutable, getOwnerTask
 
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName
 

Constructor Detail

AbstractSubTask

public AbstractSubTask()
Method Detail

getAssignedLabel

public Label getAssignedLabel()
Description copied from interface: SubTask
If this task needs to be run on a node with a particular label, return that Label. Otherwise null, indicating it can run on anywhere.

Specified by:
getAssignedLabel in interface SubTask

getLastBuiltOn

public Node getLastBuiltOn()
Description copied from interface: SubTask
If the previous execution of this task run on a certain node and this task prefers to run on the same node, return that. Otherwise null.

Specified by:
getLastBuiltOn in interface SubTask

getEstimatedDuration

public long getEstimatedDuration()
Description copied from interface: SubTask
Estimate of how long will it take to execute this task. Measured in milliseconds.

Specified by:
getEstimatedDuration in interface SubTask
Returns:
-1 if it's impossible to estimate.

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

getResourceList

public ResourceList getResourceList()
Description copied from interface: ResourceActivity
Gets the list of Resources that this task requires. Used to make sure no two conflicting tasks run concurrently.

This method must always return the ResourceList that contains the exact same set of Resources.

If the activity doesn't lock any resources, just return new ResourceList().

Specified by:
getResourceList in interface ResourceActivity
Returns:
never null


Copyright © 2004-2013. All Rights Reserved.