Class TaskGroup

  • All Implemented Interfaces:
    ITaskGroup

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

      Constructors 
      Constructor Description
      TaskGroup​(java.lang.String taskId, TaskManager tmgr, java.lang.Runnable task)
      Public constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChildTaskGroups​(java.util.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
      void addDependsOnThis​(ITaskGroup tg)
      Add the given ITaskGroup to the list of task groups depending on this task group.
      void addParent​(ITaskGroup parent)
      Add the given parent as one of the parents of this task group
      boolean equals​(java.lang.Object other)  
      java.lang.String getTaskId()  
      int hashCode()  
      void runTask()
      Called when the ExecutorService executes this task
      void runTask​(java.util.concurrent.ExecutorService pool)
      Submit this task to the thread-pool
      void taskCompletionCallback​(ITaskGroup tg)
      Called when a child task completes.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TaskGroup

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

      • getTaskId

        public java.lang.String getTaskId()
        Specified by:
        getTaskId in interface ITaskGroup
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.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​(java.util.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​(java.util.concurrent.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