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 Object implements ITaskGroup
The TaskGroup to organize a set of ongoing or pending tasks.
-
-
Constructor Summary
Constructors Constructor Description TaskGroup(String taskId, TaskManager tmgr, Runnable task)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildTaskGroups(List<ITaskGroup> children)Add the list of children to this task group, and make sure each of those children know what we are its parentvoidaddDependsOnThis(ITaskGroup tg)Add the givenITaskGroupto the list of task groups depending on this task group.voidaddParent(ITaskGroup parent)Add the given parent as one of the parents of this task groupbooleanequals(Object other)StringgetTaskId()inthashCode()voidrunTask()Called when the ExecutorService executes this taskvoidrunTask(ExecutorService pool)Submit this task to the thread-poolvoidtaskCompletionCallback(ITaskGroup tg)Called when a child task completes.StringtoString()
-
-
-
Constructor Detail
-
TaskGroup
public TaskGroup(String taskId, TaskManager tmgr, Runnable task)
Public constructor- Parameters:
taskId-tmgr-task-
-
-
Method Detail
-
getTaskId
public String getTaskId()
- Specified by:
getTaskIdin interfaceITaskGroup
-
addDependsOnThis
public void addDependsOnThis(ITaskGroup tg)
Add the givenITaskGroupto 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:ITaskGroupCalled when a child task completes.- Specified by:
taskCompletionCallbackin interfaceITaskGroup
-
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:ITaskGroupAdd the given parent as one of the parents of this task group- Specified by:
addParentin interfaceITaskGroup
-
-