Class QueueTaskDispatcher

  extended by hudson.model.queue.QueueTaskDispatcher
All Implemented Interfaces:

public abstract class QueueTaskDispatcher
extends Object
implements ExtensionPoint

Vetos the execution of a task on a node

To register your dispatcher implementations, put

Kohsuke Kawaguchi

Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
Constructor Summary
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


public QueueTaskDispatcher()
Method Detail


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


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

Copyright © 2004-2013 Hudson. All Rights Reserved.