org.jvnet.hudson.reactor
Class TaskGraphBuilder

java.lang.Object
  extended by org.jvnet.hudson.reactor.TaskBuilder
      extended by org.jvnet.hudson.reactor.TaskGraphBuilder

public class TaskGraphBuilder
extends TaskBuilder

Builder/fluent-API pattern to build up a series of related tasks.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static interface TaskGraphBuilder.Handle
          Handle to the task.
 
Field Summary
 
Fields inherited from class org.jvnet.hudson.reactor.TaskBuilder
EMPTY_BUILDER
 
Constructor Summary
TaskGraphBuilder()
           
 
Method Summary
 TaskGraphBuilder.Handle add(java.lang.String displayName, Executable e)
          Adds a new work unit and returns its handle, which can then be used to set up dependencies among them.
 TaskGraphBuilder attains(Milestone... milestones)
          Given milestones will be set as achievements for the next task.
 java.lang.Iterable<? extends Task> discoverTasks(Reactor reactor)
          Returns all the tasks that this builder contributes to.
 TaskGraphBuilder followedBy()
          Indicates that the task to be added requires the completion of the last added task.
 TaskGraphBuilder notFatal()
           
 TaskGraphBuilder requires(Milestone... milestones)
          Given milestones will be set as pre-requisites for the next task to be added.
 
Methods inherited from class org.jvnet.hudson.reactor.TaskBuilder
fromTasks, union, union
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskGraphBuilder

public TaskGraphBuilder()
Method Detail

discoverTasks

public java.lang.Iterable<? extends Task> discoverTasks(Reactor reactor)
                                                 throws java.io.IOException
Description copied from class: TaskBuilder
Returns all the tasks that this builder contributes to.

Specified by:
discoverTasks in class TaskBuilder
Throws:
java.io.IOException

add

public TaskGraphBuilder.Handle add(java.lang.String displayName,
                                   Executable e)
Adds a new work unit and returns its handle, which can then be used to set up dependencies among them.

Parameters:
displayName - Display name of the task.
e - The actual work.

followedBy

public TaskGraphBuilder followedBy()
Indicates that the task to be added requires the completion of the last added task.


requires

public TaskGraphBuilder requires(Milestone... milestones)
Given milestones will be set as pre-requisites for the next task to be added.


attains

public TaskGraphBuilder attains(Milestone... milestones)
Given milestones will be set as achievements for the next task.


notFatal

public TaskGraphBuilder notFatal()


Copyright © 2011. All Rights Reserved.