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.StructuralJob<Object>
              extended by org.oddjob.jobs.job.RunJob
All Implemented Interfaces:
Serializable, Runnable, ArooaContextAware, ArooaSessionAware, ConfigurationOwner, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable, Structural

public class RunJob
extends StructuralJob<Object>
implements Structural, Stoppable, ConfigurationOwner

Description

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

This job reflects the state of the job being executed.

Example

Examples elsewhere.
See Also:
Serialized Form
Author:
Rob Gordon

Field Summary
 
Fields inherited from class org.oddjob.framework.StructuralJob
childHelper, childStateReflector, stateHandler, stop, structuralState
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
RunJob()
           
 
Method Summary
 void addOwnerStateListener(OwnerStateListener listener)
          Add a listener.
protected  void execute()
          Execute this job.
protected  StateOperator getInitialStateOp()
          Subclasses must provide the StateOperator that will decide how to evaluate the children's state.
 Object getJob()
          Get the job.
 boolean hardReset()
          Perform a hard reset on the job.
 ConfigurationSession provideConfigurationSession()
          Provide a ConfigurationSession.
 void removeOwnerStateListener(OwnerStateListener listener)
          Remove a listener.
 DesignFactory rootDesignFactory()
          Get the design factory for the configuration.
 ArooaElement rootElement()
          Get the root element.
 void setJob(Object node)
          Set the stop node directly.
protected  void sleep(long waitTime)
          Sleep.
 boolean softReset()
          Perform a soft reset on the job.
 
Methods inherited from class org.oddjob.framework.StructuralJob
addStructuralListener, fireDestroyedState, force, getStateChanger, isStop, onDestroy, onReset, onStop, removeStructuralListener, run, startChildStateReflector, 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.Structural
addStructuralListener, removeStructuralListener
 
Methods inherited from interface org.oddjob.Stoppable
stop
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

RunJob

public RunJob()
Method Detail

setJob

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

Parameters:
node - The job.

getJob

public Object getJob()
Get the job.

Returns:
The node.

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<Object>
Returns:
A State Operator. Must not be null.

execute

protected void execute()
                throws Exception
Description copied from class: StructuralJob
Execute this job.

Specified by:
execute in class StructuralJob<Object>
Throws:
Exception - If the unexpected occurs.

sleep

protected void sleep(long waitTime)
Sleep. This is a copy of SimpleJob.sleep(long).

Parameters:
waitTime - Time in milliseconds to sleep for.

softReset

public boolean softReset()
Perform a soft reset on the job.

Specified by:
softReset in interface Resetable
Overrides:
softReset in class StructuralJob<Object>
Returns:
true if successful.

hardReset

public boolean hardReset()
Perform a hard reset on the job.

Specified by:
hardReset in interface Resetable
Overrides:
hardReset in class StructuralJob<Object>
Returns:
true if successful.

addOwnerStateListener

public void addOwnerStateListener(OwnerStateListener listener)
Description copied from interface: ConfigurationOwner
Add a listener.

Specified by:
addOwnerStateListener in interface ConfigurationOwner

removeOwnerStateListener

public void removeOwnerStateListener(OwnerStateListener listener)
Description copied from interface: ConfigurationOwner
Remove a listener.

Specified by:
removeOwnerStateListener in interface ConfigurationOwner

provideConfigurationSession

public ConfigurationSession provideConfigurationSession()
Description copied from interface: ConfigurationOwner
Provide a ConfigurationSession.

Specified by:
provideConfigurationSession in interface ConfigurationOwner
Returns:
A ConfigurationSession. My be null if no session is available.

rootDesignFactory

public DesignFactory rootDesignFactory()
Description copied from interface: ConfigurationOwner
Get the design factory for the configuration. If this is null the Oddjob Explorer won't show a DesignInside action.

Specified by:
rootDesignFactory in interface ConfigurationOwner
Returns:
A DesignFactory. Must not be null if a ConfigurationSession is available.

rootElement

public ArooaElement rootElement()
Description copied from interface: ConfigurationOwner
Get the root element.

Specified by:
rootElement in interface ConfigurationOwner
Returns:
The root element of the configuration. Must not be null if a ConfiguraitonSession is available.