Brooklyn

brooklyn.util.task
[Java] Class TaskBuilder

java.lang.Object
  brooklyn.util.task.TaskBuilder

public class TaskBuilder

Convenience for creating tasks; note that DynamicSequentialTask is the default


Method Summary
TaskBuilder add(Task child)

adds a child to the given task; the semantics of how the child is executed is set using dynamic(boolean) and parallel(boolean)

TaskBuilder body(java.util.concurrent.Callable body)

TaskBuilder body(java.lang.Runnable body)

Task build()

TaskFactory buildFactory()

returns a a factory based on this builder

static TaskBuilder builder()

TaskBuilder dynamic(boolean dynamic)

whether task that is built has been explicitly specified to be a dynamic task (ie a Task which is also a TaskQueueingContext whereby new tasks can be added after creation

TaskBuilder name(java.lang.String name)

TaskBuilder parallel(boolean parallel)

whether task that is built should be parallel; cannot (currently) also be dynamic

TaskBuilder tag(java.lang.Object tag)

adds a tag to the given task

java.lang.String toString()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

add

public TaskBuilder add(Task child)
adds a child to the given task; the semantics of how the child is executed is set using dynamic(boolean) and parallel(boolean)


body

public TaskBuilder body(java.util.concurrent.Callable body)


body

public TaskBuilder body(java.lang.Runnable body)


build

@SuppressWarnings({ "unchecked", "rawtypes" })
public Task build()


buildFactory

public TaskFactory buildFactory()
returns a a factory based on this builder


builder

public static TaskBuilder builder()


dynamic

public TaskBuilder dynamic(boolean dynamic)
whether task that is built has been explicitly specified to be a dynamic task (ie a Task which is also a TaskQueueingContext whereby new tasks can be added after creation


name

public TaskBuilder name(java.lang.String name)


parallel

public TaskBuilder parallel(boolean parallel)
whether task that is built should be parallel; cannot (currently) also be dynamic


tag

public TaskBuilder tag(java.lang.Object tag)
adds a tag to the given task


toString

}
public java.lang.String toString()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.