Class StructuralStateHelper

java.lang.Object
org.oddjob.state.StructuralStateHelper
All Implemented Interfaces:
Stateful

public class StructuralStateHelper extends Object implements Stateful
Track, and aggregate the states of child jobs. Aggregation is achieved using the given StateOperator.
Author:
rob
  • Constructor Details

    • StructuralStateHelper

      public StructuralStateHelper(Structural structural, StateOperator operator)
      Create a new instance that will track state changes in the children of the given Structural. States of the children will be combined using the given StateOperator.
      Parameters:
      structural - The structural. Must not be null.
      operator - The operator that combines child state. Must not be null.
  • Method Details

    • addStateListener

      public void addStateListener(StateListener listener)
      Description copied from interface: Stateful
      Add a job state listener.
      Specified by:
      addStateListener in interface Stateful
      Parameters:
      listener - The listener.
    • removeStateListener

      public void removeStateListener(StateListener listener)
      Description copied from interface: Stateful
      Remove a job state listener.
      Specified by:
      removeStateListener in interface Stateful
      Parameters:
      listener - The listener.
    • lastStateEvent

      public StateEvent lastStateEvent()
      Description copied from interface: Stateful
      Get the last state event.
      Specified by:
      lastStateEvent in interface Stateful
      Returns:
      The last State Event
    • getChildStates

      public StateEvent[] getChildStates()
    • getStateOperator

      public StateOperator getStateOperator()
    • setStateOperator

      public void setStateOperator(StateOperator stateOperator)
      Change the State Operator to be used to combine child state.
      Parameters:
      stateOperator - The State Operator. Must not be null.