Package org.oddjob.jobs
Class WaitJob
- All Implemented Interfaces:
Runnable,ArooaContextAware,ArooaSessionAware,Forceable,PropertyChangeNotifier,Iconic,LogEnabled,Resettable,Stateful,Stoppable
- Author:
- Rob Gordon
Description
This Job will either wait a given number of milliseconds or will wait for a property or job to become available.If the for property is provided, then the delay is used as the number of milliseconds between checking if the property is available.
Example
TheExecutorThrottleType has a simple example.This example waits for a variable 'text' to be set. The value could be set
across the network or by a another job running in parallel.
<sequential name="Waiting For a Property">
<jobs>
<variables id="waitvars"/>
<wait name="Wait for Variable" for="${waitvars.text}" pause="2000"/>
<echo name="Echo Text">${waitvars.text}</echo>
</jobs>
</sequential>
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintexecute()Execute this job.getFor()longgetPause()Get the delay time in milli seconds.getState()voidvoidsetPause(long delay) Set the delay time in milli seconds.voidsetState(StateCondition state) protected voidprotected voidwaitFor()protected voidMethods inherited from class org.oddjob.framework.extend.SimpleJob
fireDestroyedState, force, getStateChanger, hardReset, iconHelper, isStop, onDestroy, onReset, onStop, run, sleep, softReset, stateHandler, stopMethods inherited from class org.oddjob.framework.extend.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toStringMethods inherited from class org.oddjob.framework.extend.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSessionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
-
Constructor Details
-
WaitJob
public WaitJob()
-
-
Method Details
-
setPause
public void setPause(long delay) Set the delay time in milli seconds.- Parameters:
delay- The delay time.
-
getPause
public long getPause()Get the delay time in milli seconds.- Returns:
- The delay time.
-
execute
Description copied from class:SimpleJobExecute this job. -
simpleWait
protected void simpleWait() -
waitFor
protected void waitFor() -
waitForState
protected void waitForState() -
getFor
-
setFor
-
getState
-
setState
-