Interface RetryPolicyProvider

  • All Known Implementing Classes:
    DefaultRetryPolicyProvider

    public interface RetryPolicyProvider
    Retry policy providers implement this interface in order to control retry behavior such as if and when a request should be retried after a network failure, retry frequencies and limits, etc.

    Author:
    Todd S. Murchison
    • Method Detail

      • shouldRetry

        RetryProfile shouldRetry​(Work work,
                                 Exception error)
        Called by the CommManager when network request work results in an exception. The RetryProfile instance returned is used to determine if and how the request should be retried.
        Parameters:
        work - The Work that resulted in the given Exception.
        error - The Exception thrown while attempting the given Request work.
        Returns:
        A RetryProfile instance used to determine if and how the request should be retried.
      • shouldRetry

        RetryProfile shouldRetry​(Work work,
                                 Response response)
        Called by the CommManager when network request work results in a response back from the remote resource. The RetryProfile instance returned is used to determine if and how the request should be retried.
        Parameters:
        work - The Work that resulted in the given Response.
        response - The Response instance resulting from the given Request work.
        Returns:
        A RetryProfile instance used to determine if and how the request should be retried.