public class RepeatJob extends StructuralJob<Runnable> implements Stoppable
Without either a until or a times or values the job will loop indefinitely.
<oddjob> <job> <repeat times="3" id="repeat"> <job> <echo>Hello ${repeat.count}</echo> </job> </repeat> </job> </oddjob>
<oddjob> <job> <repeat id="each"> <values> <sequence from="1" to="3"/> </values> <job> <echo>Hello ${each.current}</echo> </job> </repeat> </job> </oddjob>
childHelper, childStateReflector, destroy, stop, structuralState
Constructor and Description |
---|
RepeatJob() |
Modifier and Type | Method and Description |
---|---|
protected void |
execute()
Execute this job.
|
int |
getCount() |
Object |
getCurrent() |
int |
getIndex() |
protected StateOperator |
getInitialStateOp()
Subclasses must provide the
StateOperator that will decide
how to evaluate the children's state. |
int |
getTimes() |
Iterable<?> |
getValues() |
boolean |
isUntil() |
protected void |
onHardReset()
Allow sub classes to do something on HARD reset.
|
void |
setJob(Runnable child) |
void |
setTimes(int times) |
void |
setUntil(boolean until) |
void |
setValues(Iterable<?> values) |
addStructuralListener, fireDestroyedState, force, getStateChanger, hardReset, iconHelper, isStop, onDestroy, onReset, onSoftReset, onStop, removeStructuralListener, run, softReset, startChildStateReflector, stateHandler, stop
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
protected StateOperator getInitialStateOp()
StructuralJob
StateOperator
that will decide
how to evaluate the children's state.getInitialStateOp
in class StructuralJob<Runnable>
public void setJob(Runnable child)
Property: job
Description: The job who's execution to schedule.
Required: Yes.
protected void execute()
StructuralJob
execute
in class StructuralJob<Runnable>
protected void onHardReset()
StructuralJob
onHardReset
in class StructuralJob<Runnable>
public void setValues(Iterable<?> values)
public Iterable<?> getValues()
public boolean isUntil()
public void setUntil(boolean until)
public int getTimes()
public void setTimes(int times)
public int getCount()
public int getIndex()
Property: index
Description: The same as count. Provided so configurations
can be swapped between this and ForEachJob
job.
public Object getCurrent()