hudson.model.queue
Class WorkUnitContext

java.lang.Object
  extended by hudson.model.queue.WorkUnitContext

public final class WorkUnitContext
extends Object

Holds the information shared between WorkUnits created from the same Queue.Task.

Author:
Kohsuke Kawaguchi

Field Summary
 List<Action> actions
          Associated parameters to the build.
 FutureImpl future
          Once the execution starts and completes, update this future object with the outcome.
 Queue.BuildableItem item
           
 Queue.Task task
           
 
Constructor Summary
WorkUnitContext(Queue.BuildableItem item)
           
 
Method Summary
 void abort(Throwable cause)
          When one of the work unit is aborted, call this method to abort all the other work units.
 WorkUnit createWorkUnit(SubTask execUnit)
          Called by the executor that executes a member SubTask that belongs to this task to create its WorkUnit.
 WorkUnit getPrimaryWorkUnit()
           
 List<WorkUnit> getWorkUnits()
           
 void synchronizeEnd(Queue.Executable executable, Throwable problems, long duration)
          All the Executors that jointly execute a Queue.Task call this method to synchronize on the end of the task.
 void synchronizeStart()
          All the Executors that jointly execute a Queue.Task call this method to synchronize on the start.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

item

public final Queue.BuildableItem item

task

public final Queue.Task task

future

public final FutureImpl future
Once the execution starts and completes, update this future object with the outcome.


actions

public final List<Action> actions
Associated parameters to the build.

Constructor Detail

WorkUnitContext

public WorkUnitContext(Queue.BuildableItem item)
Method Detail

createWorkUnit

public WorkUnit createWorkUnit(SubTask execUnit)
Called by the executor that executes a member SubTask that belongs to this task to create its WorkUnit.


getWorkUnits

public List<WorkUnit> getWorkUnits()

getPrimaryWorkUnit

public WorkUnit getPrimaryWorkUnit()

synchronizeStart

public void synchronizeStart()
                      throws InterruptedException
All the Executors that jointly execute a Queue.Task call this method to synchronize on the start.

Throws:
InterruptedException

synchronizeEnd

public void synchronizeEnd(Queue.Executable executable,
                           Throwable problems,
                           long duration)
                    throws InterruptedException
All the Executors that jointly execute a Queue.Task call this method to synchronize on the end of the task.

Throws:
InterruptedException - If any of the member thread is interrupted while waiting for other threads to join, all the member threads will report InterruptedException.

abort

public void abort(Throwable cause)
When one of the work unit is aborted, call this method to abort all the other work units.



Copyright © 2004-2013. All Rights Reserved.