Package jadex.commons.future
Class FutureFinishChecker
- java.lang.Object
- 
- jadex.commons.future.FutureFinishChecker
 
- 
 public class FutureFinishChecker extends java.lang.ObjectAllows monitoring a number of tasks (futures) and get a notification when set to finished (no more new tasks) and all tasks have been processed (futures notified).
- 
- 
Field SummaryFields Modifier and Type Field Description protected IResultListenerdelegateThe delegate to be notified.protected booleanfinishedFlag, if set to finished (no more tasks allowed and notfication when all tasks finished).protected booleannotifiedFlag to remember that delegate was notified.protected java.util.ListtasksThe list of future tasks to observe.
 - 
Constructor SummaryConstructors Constructor Description FutureFinishChecker(IResultListener delegate)Create a new checker.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTask(Future future)Add a task.voidcheck()Check if completed.voidfinished()Set to finished.
 
- 
- 
- 
Field Detail- 
delegateprotected IResultListener delegate The delegate to be notified.
 - 
tasksprotected java.util.List tasks The list of future tasks to observe.
 - 
finishedprotected boolean finished Flag, if set to finished (no more tasks allowed and notfication when all tasks finished).
 - 
notifiedprotected boolean notified Flag to remember that delegate was notified.
 
- 
 - 
Constructor Detail- 
FutureFinishCheckerpublic FutureFinishChecker(IResultListener delegate) Create a new checker.
 
- 
 - 
Method Detail- 
addTaskpublic void addTask(Future future) Add a task.
 - 
finishedpublic void finished() Set to finished.
 - 
checkpublic void check() Check if completed.
 
- 
 
-