Package de.uka.ipd.sdq.workflow.jobs
Class ParallelJob
java.lang.Object
de.uka.ipd.sdq.workflow.jobs.AbstractJob
de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
de.uka.ipd.sdq.workflow.jobs.ParallelJob
- All Implemented Interfaces:
ICompositeJob
,IJob
,Iterable<IJob>
,Collection<IJob>
,List<IJob>
- Direct Known Subclasses:
ParallelBlackboardInteractingJob
Runs a set of jobs in parallel. The jobs are executed asynchronously and
joined on a barrier before continuing the main workflow
-
Field Summary
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
ConstructorDescriptionInitialise a parallel job containing a number of child jobs with a thread pool size equal to the number of CPU cores.ParallelJob
(int threadPoolSize) Initialise a parallel job with the given thread pool size to be used for job execution. -
Method Summary
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
-
Constructor Details
-
ParallelJob
public ParallelJob()Initialise a parallel job containing a number of child jobs with a thread pool size equal to the number of CPU cores. -
ParallelJob
public ParallelJob(int threadPoolSize) Initialise 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
Description copied from interface:IJob
Execute the job. In case of an error throw an exception with a meaningful name which can be understood by a user.- Specified by:
execute
in interfaceIJob
- Specified by:
execute
in classAbstractCompositeJob
- Parameters:
monitor
- the monitor- Throws:
JobFailedException
- the job failedUserCanceledException
- the user has chosen to abort the job
-