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, myJobsFields inherited from class de.uka.ipd.sdq.workflow.jobs.AbstractJob
logger -
Constructor Summary
ConstructorsConstructorDescriptionInitialise 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, 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
-
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:IJobExecute the job. In case of an error throw an exception with a meaningful name which can be understood by a user.- Specified by:
executein interfaceIJob- Specified by:
executein classAbstractCompositeJob- Parameters:
monitor- the monitor- Throws:
JobFailedException- the job failedUserCanceledException- the user has chosen to abort the job
-