org.oddjob.jobs.job
Class DependsJob
java.lang.Object
org.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.framework.SimpleJob
org.oddjob.jobs.job.DependsJob
- All Implemented Interfaces:
- Runnable, ArooaContextAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, StateListener, Stateful, Stoppable
public class DependsJob
- extends SimpleJob
- implements Stoppable, StateListener
Description
A job which depends on another job.
- If the other job is in a READY state, this job will run
the other job.
- If the other job is in an EXECUTING state, this job
will wait.
- If the other job has finished this job will reflect the
completion state.
This job is intended to simulate Ant's dependency like
functionality however it's usefulness is currently
questionable. Solutions using Trigger may well be
more elegant.- Author:
- Rob Gordon
| Methods inherited from class org.oddjob.framework.SimpleJob |
fireDestroyedState, force, getStateChanger, hardReset, onDestroy, onReset, onStop, run, sleep, softReset, 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 |
DependsJob
public DependsJob()
setJob
public void setJob(Stateful node)
- Set the stop node directly.
- Parameters:
node - The node to stop.
getJob
public Stateful getJob()
- Get the node to stop.
- Returns:
- The node.
execute
protected int execute()
throws Throwable
- Description copied from class:
SimpleJob
- Execute this job.
- Specified by:
execute in class SimpleJob
- Returns:
- 0 if the job is complete, anything else otherwise.
- Throws:
Exception - If the unexpected occurs.
Throwable
jobStateChange
public void jobStateChange(StateEvent event)
- Description copied from interface:
StateListener
- Triggered when the job state changes.
- Specified by:
jobStateChange in interface StateListener
- Parameters:
event - The job state event.