Class ExecutionGroup


  • public abstract class ExecutionGroup
    extends java.lang.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 Detail

      • ExecutionGroup

        public ExecutionGroup()
    • Method Detail

      • add

        public ExecutionGroup add​(java.util.concurrent.Callable<?> theTask)
      • addAll

        public ExecutionGroup addAll​(java.util.Iterator<java.util.concurrent.Callable<?>> theTasks)
      • addAll

        public ExecutionGroup addAll​(java.lang.Iterable<java.util.concurrent.Callable<?>> theTasks)
      • performAdd

        protected abstract void performAdd​(java.util.concurrent.Callable<?> theTask)
      • executeAndWait

        public abstract void executeAndWait()
                                     throws java.util.concurrent.ExecutionException,
                                            java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • execute

        public abstract java.lang.Iterable<java.util.concurrent.Future<?>> execute()
                                                                            throws java.util.concurrent.ExecutionException,
                                                                                   java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • isExecuting

        public abstract boolean isExecuting()
      • concurrent

        public static ExecutionGroup concurrent​(java.util.concurrent.ExecutorService theExecutorService)