|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.framework.SimpleJob
public abstract class SimpleJob
An abstract implementation of a job which provides common functionality to concrete sub classes.
| Field Summary | |
|---|---|
protected JobStateHandler |
stateHandler
|
protected boolean |
stop
This flag is set by the stop method and should be examined by any Stoppable sub classes in their processing loop. |
| Fields inherited from class org.oddjob.framework.BaseComponent |
|---|
iconHelper |
| Constructor Summary | |
|---|---|
protected |
SimpleJob()
|
| Method Summary | |
|---|---|
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 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()
|
void |
stop()
Allow subclasses to indicate they are stopping. |
| Methods inherited from class org.oddjob.framework.BasePrimary |
|---|
configure, getName, logger, logger, loggerName, save, setName, toString |
| Methods inherited from class org.oddjob.framework.BaseComponent |
|---|
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.oddjob.Stateful |
|---|
addStateListener, lastStateEvent, removeStateListener |
| Field Detail |
|---|
protected transient JobStateHandler stateHandler
protected transient volatile boolean stop
| Constructor Detail |
|---|
protected SimpleJob()
| Method Detail |
|---|
protected JobStateHandler stateHandler()
stateHandler in class BaseComponentprotected StateChanger<JobState> getStateChanger()
protected abstract int execute()
throws Throwable
Exception - If the unexpected occurs.
Throwablepublic final void run()
run in interface Runnableprotected void sleep(long waitTime)
waitTime - Milliseconds to sleep for.
public final void stop()
throws FailedToStopException
FailedToStopException
protected void onStop()
throws FailedToStopException
FailedToStopExceptionpublic boolean softReset()
softReset in interface Resetablepublic boolean hardReset()
hardReset in interface Resetableprotected void onReset()
public void force()
force in interface Forceableprotected void onDestroy()
BaseComponent
onDestroy in class BaseComponentprotected void fireDestroyedState()
fireDestroyedState in class BaseComponent
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||