Interface StatePollContext<S>


public interface StatePollContext<S>
Context for a particular poll of state.
Author:
Daniel Sagenschneider
  • Method Summary

    Modifier and Type
    Method
    Description
    Obtains the current state.
    void
    setFailure(Throwable cause, long nextPollInterval, TimeUnit unit)
    Indicates there was a failure in polling.
    void
    setFinalState(S finalState)
    Sets the state and stops polling.
    void
    setNextState(S nextState, long nextPollInterval, TimeUnit unit)
    Sets the next state.
  • Method Details

    • getCurrentState

      S getCurrentState()
      Obtains the current state.
      Returns:
      Current state. May be null if initial poll.
    • setNextState

      void setNextState(S nextState, long nextPollInterval, TimeUnit unit)
      Sets the next state.
      Parameters:
      nextState - Next state.
      nextPollInterval - Interval until next poll. Value of 0 or less results in the default poll interval.
      unit - TimeUnit for the poll interval.
    • setFinalState

      void setFinalState(S finalState)
      Sets the state and stops polling.
      Parameters:
      finalState - Final state before stop polling.
    • setFailure

      void setFailure(Throwable cause, long nextPollInterval, TimeUnit unit)
      Indicates there was a failure in polling.
      Parameters:
      cause - Cause of the failure.
      nextPollInterval - Interval until next poll. Value of 0 or less results in the default poll interval.
      unit - TimeUnit for the poll interval.