|
||||||||
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 BaseComponent
protected StateChanger<JobState> getStateChanger()
protected abstract int execute() throws Throwable
Exception
- If the unexpected occurs.
Throwable
public final void run()
run
in interface Runnable
protected void sleep(long waitTime)
waitTime
- Milliseconds to sleep for.public final void stop() throws FailedToStopException
FailedToStopException
protected void onStop() throws FailedToStopException
FailedToStopException
public boolean softReset()
softReset
in interface Resetable
public boolean hardReset()
hardReset
in interface Resetable
protected void onReset()
public void force()
force
in interface Forceable
protected void onDestroy()
BaseComponent
onDestroy
in class BaseComponent
protected void fireDestroyedState()
fireDestroyedState
in class BaseComponent
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |