public class CascadeJob extends StructuralJob<java.lang.Object>
SequentialJob
task in that the latter
follows the thread of execution, and only checks state to ensure
it can continue. This job's thread of execution passes onwards after the
cascade has been set up. This job will complete asynchronously once all
it's children have completed.
SequentialJob
does. The state behaviour is equivalent to the
WORST state operator, which is what is desired in most situations. A
stateOperator
property may be added in future versions
if needed.<oddjob> <job> <cascade> <jobs> <echo>This runs first.</echo> <echo>Then this.</echo> </jobs> </cascade> </job> </oddjob>
ParallelJob
. The cascade will
wait for the parallel job to finish before running the third job.
<oddjob> <job> <cascade> <jobs> <parallel> <jobs> <echo>Oranges could be first or second.</echo> <echo>Pears could be first or second.</echo> </jobs> </parallel> <echo>Apples are guaranteed to be third.</echo> </jobs> </cascade> </job> </oddjob>
childHelper, destroy, stop, structuralState
Constructor and Description |
---|
CascadeJob() |
Modifier and Type | Method and Description |
---|---|
protected void |
execute()
Execute this job.
|
StateCondition |
getCascadeOn() |
StateCondition |
getHaltOn() |
protected StateOperator |
getInitialStateOp()
Subclasses must provide the
StateOperator that will decide
how to evaluate the children's state. |
protected void |
onStop()
Allow sub classes to do something on stop.
|
void |
setCascadeOn(StateCondition cascadeOn) |
void |
setExecutorService(java.util.concurrent.ExecutorService executor) |
void |
setHaltOn(StateCondition haltOn) |
void |
setJobs(int index,
java.lang.Object child)
Add a child job.
|
protected void |
startChildStateReflector()
Start the child state reflector.
|
addStructuralListener, fireDestroyedState, force, getStateChanger, hardReset, iconHelper, isStop, onDestroy, onHardReset, onReset, onSoftReset, postStop, removeStructuralListener, run, softReset, stateHandler, stop, stopChildStateReflector
configure, getName, logger, logger, loggerName, save, setName, toString
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addStateListener, lastStateEvent, removeStateListener
@Inject public void setExecutorService(java.util.concurrent.ExecutorService executor)
public void setJobs(int index, java.lang.Object child)
Property: jobs
Description: The child jobs.
Required: No, but pointless if missing.
child
- A childprotected void execute() throws java.lang.InterruptedException
StructuralJob
execute
in class StructuralJob<java.lang.Object>
java.lang.InterruptedException
protected void onStop()
StructuralJob
onStop
in class StructuralJob<java.lang.Object>
protected StateOperator getInitialStateOp()
StructuralJob
StateOperator
that will decide
how to evaluate the children's state.getInitialStateOp
in class StructuralJob<java.lang.Object>
protected void startChildStateReflector()
StructuralJob
startChildStateReflector
in class StructuralJob<java.lang.Object>
public StateCondition getCascadeOn()
public void setCascadeOn(StateCondition cascadeOn)
public StateCondition getHaltOn()
public void setHaltOn(StateCondition haltOn)