Package de.uka.ipd.sdq.workflow.jobs
Class DynamicSequentialJob
java.lang.Object
de.uka.ipd.sdq.workflow.jobs.AbstractJob
de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
de.uka.ipd.sdq.workflow.jobs.SequentialJob
de.uka.ipd.sdq.workflow.jobs.DynamicSequentialJob
- All Implemented Interfaces:
ICompositeJob
,IJob
,Iterable<IJob>
,Collection<IJob>
,List<IJob>
- Direct Known Subclasses:
DynamicSequentialBlackboardInteractingJob
Implementation of a composite job that guarantees the execution of it's jobs in the order they
were added, similar to
SequentialJob
. In contrast, this class allows for dynamically
extending the job queue during job execution. As a drawback the progress reporting is not as
accurate anymore.
This should particularly allow for repeating the same Job multiple times until a certain
condition holds.-
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
ConstructorDescriptionInstantiates a new order preserving composite job.DynamicSequentialJob
(boolean cleanUpImmediately) Instantiates a new sequential job.DynamicSequentialJob
(String name) Instantiates a new order preserving composite job with a specific name.DynamicSequentialJob
(String name, boolean cleanUpImmediately) Instantiates a new model workflow job with a specific name and specifying the clean up strategy. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
executeJob
(IJob job, IProgressMonitor monitor) protected void
Executes all contained jobs, and runs their clean up methods when all jobs are finished.protected void
Specialty: Calls cleanup after the execution of each nested job and deletes the reference to that nested job.Methods inherited from class de.uka.ipd.sdq.workflow.jobs.SequentialJob
cleanup, execute
Methods inherited from class de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
add, add, addAll, addAll, addFirst, addJob, addLast, 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
-
DynamicSequentialJob
public DynamicSequentialJob()Instantiates a new order preserving composite job. -
DynamicSequentialJob
Instantiates a new order preserving composite job with a specific name.- Parameters:
name
- The name of the job sequence.
-
DynamicSequentialJob
public DynamicSequentialJob(boolean cleanUpImmediately) Instantiates a new sequential job.- Parameters:
cleanUpImmediately
- Flag if jobs should be cleaned up immediately or not.
-
DynamicSequentialJob
Instantiates a new model workflow job with a specific name and specifying the clean up strategy.- Parameters:
name
- The name of the job sequence.cleanUpImmediately
- Flag if jobs should be cleaned up immediately or not.
-
-
Method Details
-
executeWithDelayedCleanUp
protected void executeWithDelayedCleanUp(IProgressMonitor monitor) throws JobFailedException, UserCanceledException Executes all contained jobs, and runs their clean up methods when all jobs are finished.- Overrides:
executeWithDelayedCleanUp
in classSequentialJob
- Parameters:
monitor
- the monitor- Throws:
JobFailedException
- the job failed exceptionUserCanceledException
- the user canceled exception
-
executeWithImmediateCleanUp
protected void executeWithImmediateCleanUp(IProgressMonitor monitor) throws JobFailedException, UserCanceledException Specialty: Calls cleanup after the execution of each nested job and deletes the reference to that nested job. Thus, you need to make sure that no later jobs depend on these jobs intermediate results that are deleted during cleanup.- Overrides:
executeWithImmediateCleanUp
in classSequentialJob
- Parameters:
monitor
- The monitor to report the progress to.- Throws:
JobFailedException
- identifies a failed job execution.UserCanceledException
- Identifies a user has canceled the execution of the job.
-
executeJob
protected void executeJob(IJob job, IProgressMonitor monitor) throws JobFailedException, UserCanceledException
-