public abstract class SimpleJob extends BasePrimary implements java.lang.Runnable, Resettable, Stateful, Forceable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
stop |
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleJob() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
execute()
Execute this job.
|
protected void |
fireDestroyedState()
Internal method to fire state.
|
void |
force()
Force the job to COMPLETE.
|
protected StateChanger<JobState> |
getStateChanger() |
boolean |
hardReset()
Perform a hard reset on the job.
|
protected IconHelper |
iconHelper()
Subclasses must provide a
IconHelper. |
boolean |
isStop()
Getter for stop flag.
|
protected void |
onDestroy()
Subclasses override this method to clear up resources.
|
protected void |
onReset()
Allow sub classes to do something on reset.
|
protected void |
onStop()
Allow sub classes to do something on stop.
|
void |
run()
Implement the main execute method for a job.
|
protected void |
sleep(long waitTime)
Utility method to sleep a certain time.
|
boolean |
softReset()
Perform a soft reset on the job.
|
protected JobStateHandler |
stateHandler()
Subclasses must provide a
StateHandler. |
void |
stop()
Allow subclasses to indicate they are
stopping.
|
configure, getName, logger, logger, loggerName, save, setName, toStringaddIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSessionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddStateListener, lastStateEvent, removeStateListenerprotected transient volatile boolean stop
Property:
Description: This flag is set by the stop method and should be examined by any Stoppable jobs in their processing loops.
Required: Read Only.
protected JobStateHandler stateHandler()
BaseComponentStateHandler.stateHandler in class BaseComponentprotected IconHelper iconHelper()
BaseComponentIconHelper.iconHelper in class BaseComponentprotected StateChanger<JobState> getStateChanger()
protected abstract int execute()
throws java.lang.Throwable
java.lang.Exception - If the unexpected occurs.java.lang.Throwablepublic final void run()
run in interface java.lang.Runnableprotected void sleep(long waitTime)
waitTime - Milliseconds to sleep for.public final void stop()
throws FailedToStopException
FailedToStopExceptionprotected void onStop()
throws FailedToStopException
FailedToStopExceptionpublic boolean isStop()
public boolean softReset()
softReset in interface Resettablepublic boolean hardReset()
hardReset in interface Resettableprotected void onReset()
protected void onDestroy()
BaseComponentonDestroy in class BaseComponentprotected void fireDestroyedState()
fireDestroyedState in class BaseComponent