public abstract class StructuralJob<E> extends BasePrimary implements java.lang.Runnable, java.io.Serializable, Stoppable, Resettable, Stateful, Forceable, Structural
| Modifier and Type | Field and Description |
|---|---|
protected ChildHelper<E> |
childHelper
Track changes to children an notify listeners.
|
protected boolean |
destroy |
protected boolean |
stop |
protected StructuralStateHelper |
structuralState
Calculate our state based on children.
|
| Constructor and Description |
|---|
StructuralJob()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStructuralListener(StructuralListener listener)
Add a listener.
|
protected abstract void |
execute()
Execute this job.
|
protected void |
fireDestroyedState()
Internal method to fire state.
|
void |
force()
Force the job to COMPLETE.
|
protected abstract StateOperator |
getInitialStateOp()
Subclasses must provide the
StateOperator that will decide
how to evaluate the children's state. |
protected StateChanger<ParentState> |
getStateChanger() |
boolean |
hardReset()
Perform a hard reset on the job.
|
protected IconHelper |
iconHelper()
Subclasses must provide a
IconHelper. |
boolean |
isStop()
Expose the internal stop flag as a read only property.
|
protected void |
onDestroy()
Subclasses override this method to clear up resources.
|
protected void |
onHardReset()
Allow sub classes to do something on HARD reset.
|
protected void |
onReset()
Allow sub classes to do something on reset.
|
protected void |
onSoftReset()
Allow sub classes to do something on SOFT reset.
|
protected void |
onStop()
Allow sub classes to do something on stop.
|
protected void |
postStop()
Subclasses can override to perform actions once children have stopped.
|
void |
removeStructuralListener(StructuralListener listener)
Remove a listener.
|
void |
run()
Implement the main execute method for a job.
|
boolean |
softReset()
Perform a soft reset on the job.
|
protected void |
startChildStateReflector()
Start the child state reflector.
|
protected ParentStateHandler |
stateHandler()
Subclasses must provide a
StateHandler. |
void |
stop()
Implementation for a typical stop.
|
protected void |
stopChildStateReflector() |
protected boolean |
waitForChildrenOnStop() |
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 ChildHelper<E> childHelper
protected transient volatile StructuralStateHelper structuralState
protected transient volatile boolean stop
Property:
Description: Read only view of the internal stop flag. This flag is cleared with a reset.
protected transient volatile boolean destroy
protected ParentStateHandler stateHandler()
BaseComponentStateHandler.stateHandler in class BaseComponentprotected IconHelper iconHelper()
BaseComponentIconHelper.iconHelper in class BaseComponentprotected final StateChanger<ParentState> getStateChanger()
protected abstract StateOperator getInitialStateOp()
StateOperator that will decide
how to evaluate the children's state.protected abstract void 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 startChildStateReflector()
protected void stopChildStateReflector()
protected boolean waitForChildrenOnStop()
public void stop()
throws FailedToStopException
This stop implementation doesn't check that the job is executing as stop messages must cascade down the hierarchy to manually started jobs.
stop in interface StoppableFailedToStopExceptionprotected void onStop()
throws FailedToStopException
FailedToStopExceptionprotected void postStop()
throws FailedToStopException
FailedToStopExceptionpublic boolean softReset()
softReset in interface Resettablepublic boolean hardReset()
hardReset in interface Resettableprotected void onHardReset()
protected void onSoftReset()
protected void onReset()
public void addStructuralListener(StructuralListener listener)
addStructuralListener in interface Structurallistener - The listener.public void removeStructuralListener(StructuralListener listener)
removeStructuralListener in interface Structurallistener - The listener.public boolean isStop()
protected void onDestroy()
BaseComponentonDestroy in class BaseComponentprotected void fireDestroyedState()
fireDestroyedState in class BaseComponent