Package org.oddjob.state
Class StructuralStateHelper
java.lang.Object
org.oddjob.state.StructuralStateHelper
- All Implemented Interfaces:
Stateful
Track, and aggregate the states of child jobs. Aggregation is
achieved using the given
StateOperator.- Author:
- rob
-
Constructor Summary
ConstructorsConstructorDescriptionStructuralStateHelper(Structural structural, StateOperator operator) Create a new instance that will track state changes in the children of the givenStructural. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStateListener(StateListener listener) Add a job state listener.Get the last state event.voidremoveStateListener(StateListener listener) Remove a job state listener.voidsetStateOperator(StateOperator stateOperator) Change the State Operator to be used to combine child state.
-
Constructor Details
-
StructuralStateHelper
Create a new instance that will track state changes in the children of the givenStructural. States of the children will be combined using the givenStateOperator.- Parameters:
structural- The structural. Must not be null.operator- The operator that combines child state. Must not be null.
-
-
Method Details
-
addStateListener
Description copied from interface:StatefulAdd a job state listener.- Specified by:
addStateListenerin interfaceStateful- Parameters:
listener- The listener.
-
removeStateListener
Description copied from interface:StatefulRemove a job state listener.- Specified by:
removeStateListenerin interfaceStateful- Parameters:
listener- The listener.
-
lastStateEvent
Description copied from interface:StatefulGet the last state event.- Specified by:
lastStateEventin interfaceStateful- Returns:
- The last State Event
-
getChildStates
-
getStateOperator
-
setStateOperator
Change the State Operator to be used to combine child state.- Parameters:
stateOperator- The State Operator. Must not be null.
-