Package com.complexible.common.util.concurrent

# Class ExecutionGroup

java.lang.Object
com.complexible.common.util.concurrent.ExecutionGroup

public abstract class ExecutionGroup extends Object
A very light-weight utility class to make it easier to run a set of tasks together and wait until all those jobs end. The tasks can be run concurrently or sequentially depending on what kind of group has been created.

Since:
  0.9
Version:
  2.0
Author:
  Evren Sirin, Michael Grove

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ExecutionGroup()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ExecutionGroup`
  `add(Callable<?> theTask)`
  `ExecutionGroup`
  `addAll(Iterable<Callable<?>> theTasks)`
  `ExecutionGroup`
  `addAll(Iterator<Callable<?>> theTasks)`
  `static ExecutionGroup`
  `concurrent(ExecutorService theExecutorService)`
  `abstract Iterable<Future<?>>`
  `execute()`
  `abstract void`
  `executeAndWait()`
  `abstract boolean`
  `isExecuting()`
  `protected abstract void`
  `performAdd(Callable<?> theTask)`
  `static ExecutionGroup`
  `sequential()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ExecutionGroup

    public ExecutionGroup()

- ## Method Details

  - ### add

    public ExecutionGroup add(Callable<?> theTask)

  - ### addAll

    public ExecutionGroup addAll(Iterator<Callable<?>> theTasks)

  - ### addAll

    public ExecutionGroup addAll(Iterable<Callable<?>> theTasks)

  - ### performAdd

    protected abstract void performAdd(Callable<?> theTask)

  - ### executeAndWait

    public abstract void executeAndWait() throws ExecutionException, InterruptedException
    Throws:
      `ExecutionException`
      `InterruptedException`

  - ### execute

    public abstract Iterable<Future<?>> execute() throws ExecutionException, InterruptedException
    Throws:
      `ExecutionException`
      `InterruptedException`

  - ### isExecuting

    public abstract boolean isExecuting()

  - ### concurrent

    public static ExecutionGroup concurrent(ExecutorService theExecutorService)

  - ### sequential

    public static ExecutionGroup sequential()