hudson.model.queue
Class QueueTaskDispatcher

java.lang.Object
  extended by hudson.model.queue.QueueTaskDispatcher
All Implemented Interfaces:
ExtensionPoint

public abstract class QueueTaskDispatcher
extends Object
implements ExtensionPoint

Vetos the execution of a task on a node

To register your dispatcher implementations, put

Since:
1.360
Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
QueueTaskDispatcher()
           
 
Method Summary
static ExtensionList<QueueTaskDispatcher> all()
          All registered QueueTaskDispatchers.
abstract  CauseOfBlockage canTake(Node node, Queue.Task task)
          Called whenever Queue is considering to execute the given task on a given node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueTaskDispatcher

public QueueTaskDispatcher()
Method Detail

canTake

public abstract CauseOfBlockage canTake(Node node,
                                        Queue.Task task)
Called whenever Queue is considering to execute the given task on a given node.

Implementations can return null to indicate that the assignment is fine, or it can return a non-null instance to block the execution of the task on the given node.

Queue doesn't remember/cache the response from dispatchers, and instead it'll keep asking. The upside of this is that it's very easy to block execution for a limited time period ( as you just need to return null when it's ready to execute.) The downside of this is that the decision needs to be made quickly.

Vetos are additive. When multiple QueueTaskDispatchers are in the system, the task won't run on the given node if any one of them returns a non-null value. (This relationship is also the same with built-in check logic.)


all

public static ExtensionList<QueueTaskDispatcher> all()
All registered QueueTaskDispatchers.



Copyright © 2004-2013 Hudson. All Rights Reserved.