org.oddjob.jobs.structural
Class RepeatJob
java.lang.Object
org.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.framework.StructuralJob<Runnable>
org.oddjob.jobs.structural.RepeatJob
- All Implemented Interfaces:
- Serializable, Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable, Structural
public class RepeatJob
- extends StructuralJob<Runnable>
- implements Stoppable
Description
This job will repeatedly either for a number of
times or until the until property is true;
Without either a until or a times the job will loop indefinitely.
Example
Repeat a job 3 times.
<oddjob>
<job>
<repeat times="3" id="repeat">
<job>
<echo>Hello ${repeat.count}</echo>
</job>
</repeat>
</job>
</oddjob>
- See Also:
- Serialized Form
- Author:
- Rob Gordon.
Methods inherited from class org.oddjob.framework.StructuralJob |
addStructuralListener, fireDestroyedState, force, getStateChanger, hardReset, isStop, onDestroy, 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 |
RepeatJob
public RepeatJob()
getInitialStateOp
protected StateOperator getInitialStateOp()
- Description copied from class:
StructuralJob
- Subclasses must provide the
StateOperator
that will decide
how to evaluate the children's state.
- Specified by:
getInitialStateOp
in class StructuralJob<Runnable>
- Returns:
- A State Operator. Must not be null.
setJob
public void setJob(Runnable child)
Property: job
Description: The job who's execution
to schedule.
Required: Yes.
execute
protected void execute()
- Description copied from class:
StructuralJob
- Execute this job.
- Specified by:
execute
in class StructuralJob<Runnable>
onReset
protected void onReset()
- Description copied from class:
StructuralJob
- Allow sub classes to do something on reset.
- Overrides:
onReset
in class StructuralJob<Runnable>
isUntil
public boolean isUntil()
setUntil
public void setUntil(boolean until)
getTimes
public int getTimes()
setTimes
public void setTimes(int times)
getCount
public int getCount()