Package com.ibm.fhir.task.core.impl
Class TaskGroup
- java.lang.Object
-
- com.ibm.fhir.task.core.impl.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 parentvoid
addDependsOnThis(ITaskGroup tg)
Add the givenITaskGroup
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 groupboolean
equals(java.lang.Object other)
java.lang.String
getTaskId()
int
hashCode()
void
runTask()
Called when the ExecutorService executes this taskvoid
runTask(java.util.concurrent.ExecutorService pool)
Submit this task to the thread-poolvoid
taskCompletionCallback(ITaskGroup tg)
Called when a child task completes.java.lang.String
toString()
-
-
-
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 interfaceITaskGroup
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
addDependsOnThis
public void addDependsOnThis(ITaskGroup tg)
Add the givenITaskGroup
to the list of task groups depending on this task group. These task groups will be notified when we are completed.- Parameters:
tg
-
-
taskCompletionCallback
public void taskCompletionCallback(ITaskGroup tg)
Description copied from interface:ITaskGroup
Called when a child task completes.- Specified by:
taskCompletionCallback
in interfaceITaskGroup
-
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 interfaceITaskGroup
-
-