Package de.uka.ipd.sdq.workflow.jobs
Class SequentialJob
- java.lang.Object
-
- de.uka.ipd.sdq.workflow.jobs.AbstractJob
-
- de.uka.ipd.sdq.workflow.jobs.AbstractCompositeJob
-
- de.uka.ipd.sdq.workflow.jobs.SequentialJob
-
- All Implemented Interfaces:
ICompositeJob
,IJob
,Iterable<IJob>
,Collection<IJob>
,List<IJob>
- Direct Known Subclasses:
MWE2SequentialJob
,SequentialBlackboardInteractingJob
,Workflow
public class SequentialJob extends AbstractCompositeJob
Implementation of a composite job that guarantees the execution of it's jobs in the order they were added.
-
-
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
Constructors Constructor Description SequentialJob()
Instantiates a new order preserving composite job.SequentialJob(boolean cleanUpImmediately)
Instantiates a new sequential job.SequentialJob(String name)
Instantiates a new order preserving composite job with a specific name.SequentialJob(String name, boolean cleanUpImmediately)
Instantiates a new model workflow job with a specific name and specifying the clean up strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup(IProgressMonitor monitor)
If the sequential job is configured to not clean up immediately, the parents behavior is triggered.void
execute(IProgressMonitor monitor)
Executes all contained jobs, i.e.-
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 Detail
-
SequentialJob
public SequentialJob()
Instantiates a new order preserving composite job.
-
SequentialJob
public SequentialJob(String name)
Instantiates a new order preserving composite job with a specific name.- Parameters:
name
- The name of the job sequence.
-
SequentialJob
public SequentialJob(boolean cleanUpImmediately)
Instantiates a new sequential job.- Parameters:
cleanUpImmediately
- Flag if jobs should be cleaned up immediately or not.
-
SequentialJob
public SequentialJob(String name, boolean cleanUpImmediately)
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 Detail
-
execute
public void execute(IProgressMonitor monitor) throws JobFailedException, UserCanceledException
Executes all contained jobs, i.e. call execute() for them. Contained jobs can thus re-implement this method with functionality that should be executed.- Specified by:
execute
in interfaceIJob
- Specified by:
execute
in classAbstractCompositeJob
- Parameters:
monitor
- the monitor- Throws:
JobFailedException
- the job failed exceptionUserCanceledException
- the user canceled exception
-
cleanup
public void cleanup(IProgressMonitor monitor) throws CleanupFailedException
If the sequential job is configured to not clean up immediately, the parents behavior is triggered. Otherwise, the clean up has already be done. Clean up all temporary side effects of this job. This method will always be called after executing this job to remove automatically created files and to leave the environment in a state in which the whole workflow run can be started again with the same results (i.e. in which executed can be called again). Usually, cleanup is called after the whole workflow is completed to allow other jobs to use intermediate results. In some cases, cleanup can be called earlier. However, in those cases, later jobs might not be able to access the intermediate data anymore.
This method ensures to clean up all child jobs in the reverse order in which they were added.- Specified by:
cleanup
in interfaceIJob
- Overrides:
cleanup
in classAbstractCompositeJob
- Parameters:
monitor
- the monitor- Throws:
CleanupFailedException
- Thrown if a critical error occurred during clean up so that the whole workflow should abort cleaning up further jobs.
-
-