|
||||||||
| 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.StructuralJob<E>
public abstract class StructuralJob<E>
An abstract implementation of a job which provides common functionality to concrete sub classes.
| Field Summary | |
|---|---|
protected ChildHelper<E> |
childHelper
Track changes to children an notify listeners. |
protected StateExchange |
childStateReflector
Reflect state of children. |
protected ParentStateHandler |
stateHandler
|
protected boolean |
stop
|
protected StructuralStateHelper |
structuralState
Calculate our state based on children. |
| Fields inherited from class org.oddjob.framework.BaseComponent |
|---|
iconHelper |
| Constructor Summary | |
|---|---|
StructuralJob()
Constructor. |
|
| Method Summary | |
|---|---|
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 StateChanger<ParentState> |
getStateChanger()
|
protected abstract StateOperator |
getStateOp()
|
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 |
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()
|
protected ParentStateHandler |
stateHandler()
|
void |
stop()
Implementation for a typical stop. |
| 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 ParentStateHandler stateHandler
protected transient ChildHelper<E> childHelper
protected transient StructuralStateHelper structuralState
protected transient StateExchange childStateReflector
protected transient volatile boolean stop
| Constructor Detail |
|---|
public StructuralJob()
| Method Detail |
|---|
protected ParentStateHandler stateHandler()
stateHandler in class BaseComponentprotected StateChanger<ParentState> getStateChanger()
protected abstract StateOperator getStateOp()
protected abstract void execute()
throws Throwable
Exception - If the unexpected occurs.
Throwablepublic final void run()
run in interface Runnableprotected void startChildStateReflector()
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 StoppableFailedToStopException
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 Forceablepublic void addStructuralListener(StructuralListener listener)
addStructuralListener in interface Structurallistener - The listener.public void removeStructuralListener(StructuralListener listener)
removeStructuralListener in interface Structurallistener - The listener.protected 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 | |||||||