public class RepeatJob extends StructuralJob<java.lang.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, destroy, stop, structuralState| Constructor and Description |
|---|
RepeatJob() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
execute()
Execute this job.
|
int |
getCount() |
java.lang.Object |
getCurrent() |
java.util.concurrent.ExecutorService |
getExecutorService()
Getter for executor service.
|
int |
getIndex() |
protected StateOperator |
getInitialStateOp()
Subclasses must provide the
StateOperator that will decide
how to evaluate the children's state. |
int |
getTimes() |
java.lang.Iterable<?> |
getValues() |
boolean |
isUntil() |
protected void |
onHardReset()
Allow sub classes to do something on HARD reset.
|
protected void |
onStop()
Allow sub classes to do something on stop.
|
void |
setExecutorService(java.util.concurrent.ExecutorService executorService)
Set the
ExecutorService. |
void |
setJob(java.lang.Runnable child) |
void |
setTimes(int times) |
void |
setUntil(boolean until) |
void |
setValues(java.lang.Iterable<?> values) |
protected void |
startChildStateReflector()
Start the child state reflector.
|
addStructuralListener, fireDestroyedState, force, getStateChanger, hardReset, iconHelper, isStop, onDestroy, onReset, onSoftReset, postStop, removeStructuralListener, run, softReset, stateHandler, stop, stopChildStateReflector, waitForChildrenOnStopconfigure, getName, logger, logger, loggerName, save, setName, toStringaddIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSessionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddStateListener, lastStateEvent, removeStateListenerprotected StateOperator getInitialStateOp()
StructuralJobStateOperator that will decide
how to evaluate the children's state.getInitialStateOp in class StructuralJob<java.lang.Runnable>@Inject public void setExecutorService(java.util.concurrent.ExecutorService executorService)
ExecutorService.Property: executorService
Description: The ExecutorService to use. This will be automatically set by Oddjob.
Required: No.
executorService - The Executor Service.public java.util.concurrent.ExecutorService getExecutorService()
public void setJob(java.lang.Runnable child)
Property: job
Description: The job who's execution to schedule.
Required: Yes.
protected void execute()
StructuralJobexecute in class StructuralJob<java.lang.Runnable>protected void onStop()
throws FailedToStopException
StructuralJobonStop in class StructuralJob<java.lang.Runnable>FailedToStopExceptionprotected void startChildStateReflector()
StructuralJobstartChildStateReflector in class StructuralJob<java.lang.Runnable>protected void onHardReset()
StructuralJobonHardReset in class StructuralJob<java.lang.Runnable>public void setValues(java.lang.Iterable<?> values)
public java.lang.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 java.lang.Object getCurrent()