org.oddjob.jobs.job
Class RunJob

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BasePrimary
          extended by org.oddjob.framework.SimpleJob
              extended by org.oddjob.jobs.job.RunJob
All Implemented Interfaces:
Runnable, ArooaContextAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful

public class RunJob
extends SimpleJob

Description

A job which runs another job. The other job can be local or or on a server.

This jobs completion state will reflect the success of the run operation, not the state of the job being run.

Example

Examples elsewhere.
Author:
Rob Gordon

Field Summary
 
Fields inherited from class org.oddjob.framework.SimpleJob
stateHandler, stop
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
RunJob()
           
 
Method Summary
protected  int execute()
          Execute this job.
 Runnable getJob()
          Get the job.
 void setJob(Runnable node)
          Set the stop node directly.
 
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.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toString
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

RunJob

public RunJob()
Method Detail

setJob

public void setJob(Runnable node)
Set the stop node directly.

Parameters:
node - The job.

getJob

public Runnable getJob()
Get the job.

Returns:
The node.

execute

protected int execute()
               throws Exception
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.