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