Class InterceptorRetryPolicy

java.lang.Object
org.springframework.cloud.client.loadbalancer.InterceptorRetryPolicy
All Implemented Interfaces:
Serializable, org.springframework.retry.RetryPolicy

public class InterceptorRetryPolicy extends Object implements org.springframework.retry.RetryPolicy
RetryPolicy used by the LoadBalancerClient when retrying failed requests.
Author:
Ryan Baxter, Olga Maciaszek-Sharma
See Also:
  • Field Summary

    Fields inherited from interface org.springframework.retry.RetryPolicy

    NO_MAXIMUM_ATTEMPTS_SET
  • Constructor Summary

    Constructors
    Constructor
    Description
    InterceptorRetryPolicy(org.springframework.http.HttpRequest request, LoadBalancedRetryPolicy policy, ServiceInstanceChooser serviceInstanceChooser, String serviceName)
    Creates a new retry policy.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRetry(org.springframework.retry.RetryContext context)
     
    void
    close(org.springframework.retry.RetryContext context)
     
    boolean
     
    int
     
    org.springframework.retry.RetryContext
    open(org.springframework.retry.RetryContext parent)
     
    void
    registerThrowable(org.springframework.retry.RetryContext context, Throwable throwable)
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.retry.RetryPolicy

    getMaxAttempts
  • Constructor Details

    • InterceptorRetryPolicy

      public InterceptorRetryPolicy(org.springframework.http.HttpRequest request, LoadBalancedRetryPolicy policy, ServiceInstanceChooser serviceInstanceChooser, String serviceName)
      Creates a new retry policy.
      Parameters:
      request - The request that will be retried.
      policy - The retry policy from the load balancer.
      serviceInstanceChooser - The load balancer client.
      serviceName - The name of the service.
  • Method Details

    • canRetry

      public boolean canRetry(org.springframework.retry.RetryContext context)
      Specified by:
      canRetry in interface org.springframework.retry.RetryPolicy
    • open

      public org.springframework.retry.RetryContext open(org.springframework.retry.RetryContext parent)
      Specified by:
      open in interface org.springframework.retry.RetryPolicy
    • close

      public void close(org.springframework.retry.RetryContext context)
      Specified by:
      close in interface org.springframework.retry.RetryPolicy
    • registerThrowable

      public void registerThrowable(org.springframework.retry.RetryContext context, Throwable throwable)
      Specified by:
      registerThrowable in interface org.springframework.retry.RetryPolicy
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object