Class TaskGroup

  • All Implemented Interfaces:
    ITaskGroup

    public class TaskGroup
    extends Object
    implements ITaskGroup
    The TaskGroup to organize a set of ongoing or pending tasks.
    • Constructor Detail

      • TaskGroup

        public TaskGroup​(String taskId,
                         TaskManager tmgr,
                         Runnable task)
        Public constructor
        Parameters:
        taskId -
        tmgr -
        task -
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • addDependsOnThis

        public void addDependsOnThis​(ITaskGroup tg)
        Add the given ITaskGroup to the list of task groups depending on this task group. These task groups will be notified when we are completed.
        Parameters:
        tg -
      • addChildTaskGroups

        public void addChildTaskGroups​(List<ITaskGroup> children)
        Add the list of children to this task group, and make sure each of those children know what we are its parent
        Parameters:
        children -
      • runTask

        public void runTask​(ExecutorService pool)
        Submit this task to the thread-pool
        Parameters:
        pool -
      • runTask

        public void runTask()
        Called when the ExecutorService executes this task
      • addParent

        public void addParent​(ITaskGroup parent)
        Description copied from interface: ITaskGroup
        Add the given parent as one of the parents of this task group
        Specified by:
        addParent in interface ITaskGroup