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
Fields Modifier and Type Field Description protected BlackboardType
myBlackboard
The blackboard.-
Fields inherited from class de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
myExecutedJobs, myJobs
-
Fields inherited from class de.uka.ipd.sdq.workflow.jobs.AbstractJob
logger
-
-
Constructor Summary
Constructors Constructor Description 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(int threadPoolSize)
Initialize a parallel job with the given thread pool size to be used for job execution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(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.BlackboardType
getBlackboard()
Gets the blackboard.void
setBlackboard(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, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Field Detail
-
myBlackboard
protected BlackboardType extends Blackboard<?> myBlackboard
The blackboard.
-
-
Constructor Detail
-
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 Detail
-
execute
public void execute(IProgressMonitor monitor) throws JobFailedException, UserCanceledException
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:
execute
in interfaceIJob
- Overrides:
execute
in classParallelJob
- Parameters:
monitor
- the monitor- Throws:
JobFailedException
- the job failed exceptionUserCanceledException
- the user canceled exception
-
setBlackboard
public void setBlackboard(BlackboardType blackboard)
Sets the blackboard of this job to the given blackboard.- Specified by:
setBlackboard
in 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
public BlackboardType getBlackboard()
Gets the blackboard.- Returns:
- Returns the used blackboard.
-
-