Class Poller.SimplePoller

  • Enclosing class:
    Poller<T>

    protected static class Poller.SimplePoller
    extends Poller<Void>
    • Method Detail

      • check

        protected Poller.PollAnswer<Void> check​(int pollAttemptsSoFar)
        Description copied from class: Poller
        Checks whether the state being questioned has been resolved. Subclasses must override this method to return an answer that may or may not contain a content object. In a conventional implementation, if the state has been resolved, this method would return an answer with content object representing a resolution along with Poller.PollAction.RESOLVE; if the state has not yet been resolved, this method would return null as the answer content along with Poller.PollAction.CONTINUE if we should continue polling or Poller.PollAction.ABORT if polling should stop immediately anyway.

        Implementations of this method should return an answer constructed with the Poller.continuePolling(), Poller.abortPolling(), or Poller.resolve(Object) methods.

        Unconventional implementations may elect to return a non-null content object with Poller.PollAction.ABORT to provide the poll() caller a degenerate answer, perhaps indicating why state will never be resolved.

        Specified by:
        check in class Poller<Void>
        Parameters:
        pollAttemptsSoFar - the number of poll attempts prior to this poll attempt
        Returns:
        a poll answer