Interface StatePollContext<S>
public interface StatePollContext<S>
Context for a particular poll of state.
- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionObtains the current state.voidsetFailure(Throwable cause, long nextPollInterval, TimeUnit unit) Indicates there was a failure in polling.voidsetFinalState(S finalState) Sets the state and stops polling.voidsetNextState(S nextState, long nextPollInterval, TimeUnit unit) Sets the next state.
-
Method Details
-
getCurrentState
S getCurrentState()Obtains the current state.- Returns:
- Current state. May be
nullif initial poll.
-
setNextState
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-TimeUnitfor the poll interval.
-
setFinalState
Sets the state and stops polling.- Parameters:
finalState- Final state before stop polling.
-
setFailure
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-TimeUnitfor the poll interval.
-