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 S
getCurrentState()
Obtains the current state.void
setFailure(java.lang.Throwable cause, long nextPollInterval, java.util.concurrent.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, java.util.concurrent.TimeUnit unit)
Sets the next state.
-
-
-
Method Detail
-
getCurrentState
S getCurrentState()
Obtains the current state.- Returns:
- Current state. May be
null
if 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
-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(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
-TimeUnit
for the poll interval.
-
-