Package hudson.model.queue
Class QueueListener
- java.lang.Object
-
- hudson.model.queue.QueueListener
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
Queue.Saver
public abstract class QueueListener extends Object implements ExtensionPoint
Listener for events inQueue
.Queue
is highly synchronized objects, and these callbacks are invoked synchronously. To avoid the risk of deadlocks and general slow down, please minimize the amount of work callbacks will perform, and push any sizable work to asynchronous execution viaExecutor
, such asComputer.threadPoolForRemoting
.For the state transition of
Queue.Item
inQueue
, please refer to the Queue javadoc.- Since:
- 1.520
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description QueueListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExtensionList<QueueListener>
all()
Returns all the registeredQueueListener
s.void
onEnterBlocked(Queue.BlockedItem bi)
An item enters the blocked phase when there's someone saying "NO" to it proceeding to the buildable phase, such asQueueTaskDispatcher
.void
onEnterBuildable(Queue.BuildableItem bi)
An item enters the buildable phase when all signals are green (or blue!) and it's just waiting for the scheduler to allocate it to the available executor.void
onEnterWaiting(Queue.WaitingItem wi)
When a task is submitted to the queue, it first gets to the waiting phase, where it spends until the quiet period runs out and the item becomes executable.void
onLeaveBlocked(Queue.BlockedItem bi)
An item leaves the blocked phase and becomes buildable when there's no one vetoing.void
onLeaveBuildable(Queue.BuildableItem bi)
An item leaves the buildable phase.void
onLeaveWaiting(Queue.WaitingItem wi)
An item leaves the waiting phase when the current time of the system is past its due date.void
onLeft(Queue.LeftItem li)
The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running.
-
-
-
Method Detail
-
onEnterWaiting
public void onEnterWaiting(Queue.WaitingItem wi)
When a task is submitted to the queue, it first gets to the waiting phase, where it spends until the quiet period runs out and the item becomes executable.- See Also:
Queue.WaitingItem.timestamp
-
onLeaveWaiting
public void onLeaveWaiting(Queue.WaitingItem wi)
An item leaves the waiting phase when the current time of the system is past its due date. The item will then enter either the blocked phase or the buildable phase.
-
onEnterBlocked
public void onEnterBlocked(Queue.BlockedItem bi)
An item enters the blocked phase when there's someone saying "NO" to it proceeding to the buildable phase, such asQueueTaskDispatcher
. Note that waiting for an executor to become available is not a part of this.
-
onLeaveBlocked
public void onLeaveBlocked(Queue.BlockedItem bi)
An item leaves the blocked phase and becomes buildable when there's no one vetoing.
-
onEnterBuildable
public void onEnterBuildable(Queue.BuildableItem bi)
An item enters the buildable phase when all signals are green (or blue!) and it's just waiting for the scheduler to allocate it to the available executor. An item can spend considerable time in this phase for example if all the executors are busy.
-
onLeaveBuildable
public void onLeaveBuildable(Queue.BuildableItem bi)
An item leaves the buildable phase. It will move to the "left" state if the executors are allocated to it, or it will move to the blocked phase if someone starts vetoing once again.
-
onLeft
public void onLeft(Queue.LeftItem li)
The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running.
-
all
public static ExtensionList<QueueListener> all()
Returns all the registeredQueueListener
s.
-
-