|
||||||||
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 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. |
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 |
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
Property:
Description: Read only view of the internal stop flag. This flag is cleared with a reset.
Required: Read only.
Constructor Detail |
---|
public StructuralJob()
Method Detail |
---|
protected ParentStateHandler stateHandler()
stateHandler
in class BaseComponent
protected final StateChanger<ParentState> getStateChanger()
protected abstract StateOperator getInitialStateOp()
StateOperator
that will decide
how to evaluate the children's state.
protected abstract void execute() throws Throwable
Exception
- If the unexpected occurs.
Throwable
public final void run()
run
in interface Runnable
protected 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 Stoppable
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
public void addStructuralListener(StructuralListener listener)
addStructuralListener
in interface Structural
listener
- The listener.public void removeStructuralListener(StructuralListener listener)
removeStructuralListener
in interface Structural
listener
- The listener.public boolean isStop()
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 |