Class LoadBalancedRetryContext

java.lang.Object
org.springframework.core.AttributeAccessorSupport
org.springframework.retry.context.RetryContextSupport
org.springframework.cloud.client.loadbalancer.LoadBalancedRetryContext
All Implemented Interfaces:
Serializable, org.springframework.core.AttributeAccessor, org.springframework.retry.RetryContext

public class LoadBalancedRetryContext extends org.springframework.retry.context.RetryContextSupport
RetryContext for load-balanced retries.
Author:
Ryan Baxter, Olga Maciaszek-Sharma
See Also:
  • Field Summary

    Fields inherited from interface org.springframework.retry.RetryContext

    CLOSED, EXHAUSTED, MAX_ATTEMPTS, NAME, NO_RECOVERY, RECOVERED, STATE_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoadBalancedRetryContext(org.springframework.retry.RetryContext parent, org.springframework.http.HttpRequest request)
    Creates a new load-balanced context.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable ServiceInstance
     
    org.springframework.http.HttpRequest
    Gets the request that is being load-balanced.
    @Nullable ServiceInstance
    Gets the service instance used during the retry.
    void
    setPreviousServiceInstance(@Nullable ServiceInstance previousServiceInstance)
     
    void
    setRequest(org.springframework.http.HttpRequest request)
    Sets the request that is being load-balanced.
    void
    setServiceInstance(@Nullable ServiceInstance serviceInstance)
    Sets the service instance to use during the retry.

    Methods inherited from class org.springframework.retry.context.RetryContextSupport

    getLastThrowable, getParent, getRetryCount, isExhaustedOnly, registerThrowable, setExhaustedOnly, toString

    Methods inherited from class org.springframework.core.AttributeAccessorSupport

    attributeNames, computeAttribute, copyAttributesFrom, equals, getAttribute, hasAttribute, hashCode, removeAttribute, setAttribute

    Methods inherited from class Object

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

    Methods inherited from interface org.springframework.core.AttributeAccessor

    attributeNames, computeAttribute, getAttribute, hasAttribute, removeAttribute, setAttribute
  • Constructor Details

    • LoadBalancedRetryContext

      public LoadBalancedRetryContext(org.springframework.retry.RetryContext parent, org.springframework.http.HttpRequest request)
      Creates a new load-balanced context.
      Parameters:
      parent - The parent context.
      request - The request that is being load-balanced.
  • Method Details

    • getRequest

      public org.springframework.http.HttpRequest getRequest()
      Gets the request that is being load-balanced.
      Returns:
      The request that is being load-balanced.
    • setRequest

      public void setRequest(org.springframework.http.HttpRequest request)
      Sets the request that is being load-balanced.
      Parameters:
      request - The request to be load balanced.
    • getServiceInstance

      public @Nullable ServiceInstance getServiceInstance()
      Gets the service instance used during the retry.
      Returns:
      The service instance used during the retry.
    • setServiceInstance

      public void setServiceInstance(@Nullable ServiceInstance serviceInstance)
      Sets the service instance to use during the retry.
      Parameters:
      serviceInstance - The service instance to use during the retry.
    • getPreviousServiceInstance

      public @Nullable ServiceInstance getPreviousServiceInstance()
    • setPreviousServiceInstance

      public void setPreviousServiceInstance(@Nullable ServiceInstance previousServiceInstance)