public class StopJob extends SerializableJob implements Stoppable
Normally The stop job will not complete until the job it is stopping is in a not executing state. Therefore if the stop job is attempting to stop a parent job of itself the stop job could block indefinitely. This case is detected and the job enters an Exception state.
JMXClientJob
has an example where the stop
job is used to stop a client once the connection is no
longer needed.Constructor and Description |
---|
StopJob() |
Modifier and Type | Method and Description |
---|---|
protected int |
execute()
Execute this job.
|
Stoppable |
getJob()
Get the node to stop.
|
protected void |
onStop()
Allow sub classes to do something on stop.
|
void |
setJob(Stoppable node)
Set the stop node directly.
|
fireDestroyedState, force, getStateChanger, hardReset, iconHelper, isStop, onDestroy, onReset, run, sleep, softReset, stateHandler, stop
configure, getName, logger, logger, loggerName, save, setName, toString
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addStateListener, lastStateEvent, removeStateListener
public void setJob(Stoppable node)
node
- The node to stop.public Stoppable getJob()
protected int execute() throws Exception
SimpleJob
protected void onStop() throws FailedToStopException
SimpleJob
onStop
in class SimpleJob
FailedToStopException