public class StopJob extends SerializableJob implements Stoppable
Normally The stop job will not complete until the job it is stopping is in a stopped state, however if the stop job is attempting tos stop a parent of itself (and therefore itself) then this stop job will detect this and stop. It will therefore complete even if thing it is trying to stop hasn't fully stopped.
JMXClientJob
has an example where the stop
job is used to stop a client once the connection is no
longer needed.Modifier and Type | Field and Description |
---|---|
static int |
RESULT_POLL_TIMEOUT
Number of seconds to wait for a stop result.
|
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 |
setExecutorService(java.util.concurrent.ExecutorService executorService) |
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 static final int RESULT_POLL_TIMEOUT
@Inject public void setExecutorService(java.util.concurrent.ExecutorService executorService)
public void setJob(Stoppable node)
node
- The node to stop.public Stoppable getJob()
protected int execute() throws java.lang.Exception
SimpleJob
protected void onStop() throws FailedToStopException
SimpleJob
onStop
in class SimpleJob
FailedToStopException