Class ResetJob
- All Implemented Interfaces:
Runnable,ArooaContextAware,ArooaSessionAware,Forceable,PropertyChangeNotifier,Iconic,LogEnabled,Resettable,Stateful
- Author:
- Rob Gordon
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.
As of version 1.4 of Oddjob, this job can now also be used to force
jobs that are Forceable by specify 'force' as level.
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.Force a job to complete.
<oddjob>
<job>
<sequential>
<jobs>
<reset job="${echo}" level="force"/>
<echo id="echo">You will never see this!</echo>
</jobs>
</sequential>
</job>
</oddjob>
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intexecute()Execute this job.getJob()Get the node to stop.getLevel()voidSet the stop node directly.voidsetLevel(ResetAction level) Methods 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
-
ResetJob
public ResetJob()
-
-
Method Details
-
setJob
Set the stop node directly.- Parameters:
node- The node to stop.
-
getJob
Get the node to stop.- Returns:
- The node.
-
execute
Description copied from class:SimpleJobExecute this job. -
getLevel
- Returns:
- Returns the level.
-
setLevel
- Parameters:
level- The level to set.
-