org.oddjob.jobs.job
Class ResetJob
java.lang.Object
org.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.framework.SimpleJob
org.oddjob.jobs.job.ResetJob
- All Implemented Interfaces:
- Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful
public class ResetJob
- extends SimpleJob
Description
A job which resets another job. This job is
useful to reset jobs or services that have been persisted, and
loaded back in their previous COMPLETE states. The reset
can be used to set them back to READY.
A reset might also be needed before running a job elsewhere
such as on a remote server.
This job is not Serializable and so won't be persisted
itself.
See also the Resets
job.
Example
Using reset in explorer.xml.
Look at the explorer.xml file in Oddjob's home directory. This file is
loaded by the default oddjob.xml file when Oddjob first runs.
The explorer.xml configuration is run with a FilePersister
persister that persists the Explorers state when it
completes. When Oddjob is run again the Explorer will be
loaded with it's previous COMPLETE state and so won't run. The reset
is necessary to set it back to READY.
- 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 |
ResetJob
public ResetJob()
setJob
public void setJob(Resetable node)
- Set the stop node directly.
- Parameters:
node
- The node to stop.
getJob
public Resetable getJob()
- Get the node to stop.
- 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.
getLevel
public String getLevel()
- Returns:
- Returns the level.
setLevel
public void setLevel(String level)
- Parameters:
level
- The level to set.