org.oddjob.jobs.structural
Class SequentialJob
java.lang.Object
org.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.framework.StructuralJob<Object>
org.oddjob.jobs.structural.SequentialJob
- All Implemented Interfaces:
- Serializable, Runnable, ArooaContextAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable, Structural
public class SequentialJob
- extends StructuralJob<Object>
- implements Structural, Stoppable
Description
Executes it's children in a sequence. The sequence
will only continue to be executed if each child completes.
If a child is incomplete, or flags an exception then execution
will terminate and this job's state will reflect that of the
failed child.
If the failed job is later run manually and completes this Job will
reflect the new state. As such it is useful as a trigger point for
the completion of a sequence of jobs.
Example
A simple sequence of two jobs.
<oddjob>
<job>
<sequential name="A sequence of two jobs">
<jobs>
<echo>This runs first.</echo>
<echo>This runs after.</echo>
</jobs>
</sequential>
</job>
</oddjob>
- See Also:
- Serialized Form
- Author:
- Rob Gordon
| Methods inherited from class org.oddjob.framework.StructuralJob |
addStructuralListener, fireDestroyedState, force, getStateChanger, hardReset, onDestroy, onReset, onStop, removeStructuralListener, run, softReset, startChildStateReflector, stateHandler, stop |
| Methods inherited from class org.oddjob.framework.BaseComponent |
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession |
SequentialJob
public SequentialJob()
getStateOp
protected StateOperator getStateOp()
- Specified by:
getStateOp in class StructuralJob<Object>
setJobs
public void setJobs(int index,
Object child)
- Add a child.
Property: jobs
Description: The child jobs.
Required: No, but pointless if missing.
- Parameters:
child - A child
execute
public void execute()
throws Exception
- Description copied from class:
StructuralJob
- Execute this job.
- Specified by:
execute in class StructuralJob<Object>
- Throws:
Exception - If the unexpected occurs.
isIndependent
public boolean isIndependent()
setIndependent
public void setIndependent(boolean independent)
- Set whether children are considered dependent (false, default)
or independent (true).
Property: independent
Description: Whether the child jobs are independent or not.
Required: Default is dependent child jobs.
- Parameters:
independent - flag value to set