Package org.oddjob.jobs.job
Class RunJob
- All Implemented Interfaces:
Serializable,Runnable,ArooaContextAware,ArooaSessionAware,Forceable,PropertyChangeNotifier,Iconic,LogEnabled,Resettable,Stateful,Stoppable,Structural
- Author:
- Rob Gordon
- See Also:
- The
JMXClientJobjob has an example that usesrunto run a job on a remote server.
Description
A job which runs another job. The other job can be local or on a server.This job reflects the state of the job being executed.
Example
Examples elsewhere.-
Field Summary
Fields inherited from class org.oddjob.framework.extend.StructuralJob
childHelper, destroy, stop, structuralState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStructuralListener(StructuralListener listener) Add a listener.protected voidexecute()Execute this job.protected StateOperatorSubclasses must provide theStateOperatorthat will decide how to evaluate the children's state.getJob()Get the job.getReset()Getter for State Operator.booleanPerform a hard reset on the job.booleanisJoin()booleanprotected voidonStop()Allow sub classes to do something on stop.voidSet the stop node directly.voidsetJoin(boolean join) voidsetReset(ResetAction reset) voidsetShowJob(boolean showJob) voidsetStateOperator(StateOperator stateOperator) booleanPerform a soft reset on the job.Methods inherited from class org.oddjob.framework.extend.StructuralJob
fireDestroyedState, force, getStateChanger, iconHelper, isStop, onDestroy, onHardReset, onReset, onSoftReset, postStop, removeStructuralListener, run, startChildStateReflector, stateHandler, stop, stopChildStateReflector, waitForChildrenOnStopMethods 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, removeStateListenerMethods inherited from interface org.oddjob.Structural
removeStructuralListener
-
Constructor Details
-
RunJob
public RunJob()
-
-
Method Details
-
setJob
Set the stop node directly.- Parameters:
node- The job.
-
getJob
Get the job.- Returns:
- The node.
-
setStateOperator
- Parameters:
stateOperator- The state operator to be applied to children's states to derive our state.- Reference Property:
- stateOperator
- Required:
- No, default is ACTIVE.
Description
Set the way the children's state is evaluated and reflected by the parent. Values can be WORST, ACTIVE, or SERVICES. -
getStateOperator
Getter for State Operator.- Returns:
-
getInitialStateOp
Description copied from class:StructuralJobSubclasses must provide theStateOperatorthat will decide how to evaluate the children's state.- Specified by:
getInitialStateOpin classStructuralJob<Object>- Returns:
- A State Operator. Must not be null.
-
execute
Description copied from class:StructuralJobExecute this job.- Specified by:
executein classStructuralJob<Object>- Throws:
Exception- If the unexpected occurs.
-
softReset
public boolean softReset()Perform a soft reset on the job.- Specified by:
softResetin interfaceResettable- Overrides:
softResetin classStructuralJob<Object>- Returns:
- true if successful.
-
hardReset
public boolean hardReset()Perform a hard reset on the job.- Specified by:
hardResetin interfaceResettable- Overrides:
hardResetin classStructuralJob<Object>- Returns:
- true if successful.
-
onStop
Description copied from class:StructuralJobAllow sub classes to do something on stop.- Overrides:
onStopin classStructuralJob<Object>- Throws:
FailedToStopException
-
addStructuralListener
Description copied from class:StructuralJobAdd a listener. The listener will immediately receive add notifications for all existing children.- Specified by:
addStructuralListenerin interfaceStructural- Overrides:
addStructuralListenerin classStructuralJob<Object>- Parameters:
listener- The listener.
-
getReset
-
setReset
-
setJoin
public void setJoin(boolean join) -
isJoin
public boolean isJoin() -
setShowJob
public void setShowJob(boolean showJob) -
isShowJob
public boolean isShowJob()
-