Class 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:
    Serialized Form
    • Field Summary

      • Fields inherited from interface org.springframework.retry.RetryContext

        CLOSED, EXHAUSTED, NAME, 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ServiceInstance getPreviousServiceInstance()  
      org.springframework.http.HttpRequest getRequest()
      Gets the request that is being load-balanced.
      ServiceInstance getServiceInstance()
      Gets the service instance used during the retry.
      void setPreviousServiceInstance​(ServiceInstance previousServiceInstance)  
      void setRequest​(org.springframework.http.HttpRequest request)
      Sets the request that is being load-balanced.
      void setServiceInstance​(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 interface org.springframework.core.AttributeAccessor

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

      • 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 Detail

      • 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 ServiceInstance getServiceInstance()
        Gets the service instance used during the retry.
        Returns:
        The service instance used during the retry.
      • setServiceInstance

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

        public ServiceInstance getPreviousServiceInstance()
      • setPreviousServiceInstance

        public void setPreviousServiceInstance​(ServiceInstance previousServiceInstance)