Package de.uka.ipd.sdq.workflow.jobs
Class ParallelBlackboardInteractingJob<BlackboardType extends Blackboard<?>>
java.lang.Object
de.uka.ipd.sdq.workflow.jobs.AbstractJob
de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
de.uka.ipd.sdq.workflow.jobs.ParallelJob
de.uka.ipd.sdq.workflow.jobs.ParallelBlackboardInteractingJob<BlackboardType>
- Type Parameters:
BlackboardType- The type of the blackboard the job expects
- All Implemented Interfaces:
IBlackboardInteractingJob<BlackboardType>,ICompositeJob,IJob,Iterable<IJob>,Collection<IJob>,List<IJob>
public class ParallelBlackboardInteractingJob<BlackboardType extends Blackboard<?>>
extends ParallelJob
implements IBlackboardInteractingJob<BlackboardType>
Parallel composite job which is capable to provide child jobs access to a blackboard instance
during instantiation.
-
Field Summary
FieldsFields inherited from class de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
myExecutedJobs, myJobsFields inherited from class de.uka.ipd.sdq.workflow.jobs.AbstractJob
logger -
Constructor Summary
ConstructorsConstructorDescriptionInitialize a parallel job interacting with a blackboard and containing a number of child jobs with a thread pool size equal to the number of CPU cores.ParallelBlackboardInteractingJob(int threadPoolSize) Initialize a parallel job with the given thread pool size to be used for job execution. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(IProgressMonitor monitor) Set the blackboard reference to all child jobs which are black board interacting and triggers the super class execution which takes care for the parallel execution itself.Gets the blackboard.voidsetBlackboard(BlackboardType blackboard) Sets the blackboard of this job to the given blackboard.Methods inherited from class de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
add, add, addAll, addAll, addFirst, addJob, addLast, cleanup, clear, clone, contains, containsAll, descendingIterator, element, equals, get, getFirst, getLast, getName, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeAll, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, retainAll, set, setName, size, subList, toArray, toArray, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Field Details
-
myBlackboard
The blackboard.
-
-
Constructor Details
-
ParallelBlackboardInteractingJob
public ParallelBlackboardInteractingJob()Initialize a parallel job interacting with a blackboard and containing a number of child jobs with a thread pool size equal to the number of CPU cores. -
ParallelBlackboardInteractingJob
public ParallelBlackboardInteractingJob(int threadPoolSize) Initialize a parallel job with the given thread pool size to be used for job execution.- Parameters:
threadPoolSize- The amount of threads to be used to execute jobs
-
-
Method Details
-
execute
Set the blackboard reference to all child jobs which are black board interacting and triggers the super class execution which takes care for the parallel execution itself.- Specified by:
executein interfaceIJob- Overrides:
executein classParallelJob- Parameters:
monitor- the monitor- Throws:
JobFailedException- the job failed exceptionUserCanceledException- the user canceled exception
-
setBlackboard
Sets the blackboard of this job to the given blackboard.- Specified by:
setBlackboardin interfaceIBlackboardInteractingJob<BlackboardType extends Blackboard<?>>- Parameters:
blackboard- The blackboard to be used by this job- See Also:
-
IBlackboardInteractingJob#setBlackbard(de.uka.ipd.sdq.codegen.workflow.Blackboard)
-
getBlackboard
Gets the blackboard.- Returns:
- Returns the used blackboard.
-