Brooklyn

brooklyn.util.task
[Java] Class CompoundTask

java.lang.Object
  brooklyn.util.task.BasicTaskStub
      brooklyn.util.task.BasicTask
          brooklyn.util.task.CompoundTask

public abstract class CompoundTask
extends BasicTask

A Task that is comprised of other units of work: possibly a heterogeneous mix of Task, java.lang.Runnable, java.util.concurrent.Callable and groovy.lang.Closure instances. This class holds the collection of child tasks, but subclasses have the responsibility of executing them in a sensible manner by implementing the abstract runJobs method.


Field Summary
protected java.util.List children

protected java.util.List result

 
Fields inherited from class BasicTask
blockingDetails, description, displayName, em, endTimeUtc, job, log, result, startTimeUtc, submitTimeUtc, submittedByTask, tags, thread
 
Constructor Summary
CompoundTask(java.lang.Object... jobs)

Constructs a new compound task containing the specified units of work.

CompoundTask(java.util.Collection jobs)

Constructs a new compound task containing the specified units of work.

CompoundTask(java.util.Map flags, java.util.Collection jobs)

 
Method Summary
protected java.util.List getChildrenTasks()

protected java.util.List runJobs()

return value needs to be specified by subclass; subclass should also setBlockingDetails

protected void submitIfNecessary(Task task)

 
Methods inherited from class BasicTask
blockUntilEnded, blockUntilStarted, cancel, cancel, get, get, getActiveTaskStatusString, getBlockingDetails, getDescription, getDisplayName, getEndTimeUtc, getExtraStatusText, getResult, getStartTimeUtc, getStatusDetail, getStatusString, getStatusSummary, getSubmitTimeUtc, getSubmittedByTask, getTags, getThread, getUnchecked, isBegun, isCancelled, isDone, isError, isSubmitted, lookup, setBlockingDetails, setExtraStatusText, toString
 
Methods inherited from class BasicTaskStub
equals, getId, hashCode, toString
 

Field Detail

children

protected final java.util.List children


result

protected final java.util.List result


 
Constructor Detail

CompoundTask

public CompoundTask(java.lang.Object... jobs)
Constructs a new compound task containing the specified units of work.
throws:
IllegalArgumentException if any of the passed child jobs is not one of the above types
Parameters:
jobs - A potentially heterogeneous mixture of java.lang.Runnable, java.util.concurrent.Callable, groovy.lang.Closure and Task can be provided.


CompoundTask

public CompoundTask(java.util.Collection jobs)
Constructs a new compound task containing the specified units of work.
throws:
IllegalArgumentException if any of the passed child jobs is not one of the above types
Parameters:
jobs - A potentially heterogeneous mixture of java.lang.Runnable, java.util.concurrent.Callable, groovy.lang.Closure and Task can be provided.


CompoundTask

public CompoundTask(java.util.Map flags, java.util.Collection jobs)


 
Method Detail

getChildrenTasks

protected java.util.List getChildrenTasks()


runJobs

protected java.util.List runJobs()
return value needs to be specified by subclass; subclass should also setBlockingDetails
throws:
ExecutionException
throws:
InterruptedException


submitIfNecessary

@SuppressWarnings("deprecation")
protected void submitIfNecessary(Task task)


 

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