Class FirstOnStackRetryPolicy

java.lang.Object
org.springframework.retry.policy.NeverRetryPolicy
com.atlassian.confluence.impl.spring.FirstOnStackRetryPolicy
All Implemented Interfaces:
Serializable, org.springframework.retry.RetryPolicy

public class FirstOnStackRetryPolicy extends org.springframework.retry.policy.NeverRetryPolicy
Retry policy that only retries if it is the first encounter of this retry policy instance on the call stack. In effect, it ensures retries are only attempted at the top-level in situations where a service intercepted by this policy instance calls another service that is also intercepted by this same policy instance.

This policy should be used in conjunction with 1 or more other policies (using CompositeRetryPolicy) which will determine when to retry at the top-level.

Since:
9.1
See Also:
  • Field Summary

    Fields inherited from interface org.springframework.retry.RetryPolicy

    NO_MAXIMUM_ATTEMPTS_SET
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRetry(org.springframework.retry.RetryContext context)
     
    void
    close(org.springframework.retry.RetryContext context)
     
    org.springframework.retry.RetryContext
    open(org.springframework.retry.RetryContext parent)
     

    Methods inherited from class org.springframework.retry.policy.NeverRetryPolicy

    registerThrowable

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.springframework.retry.RetryPolicy

    getMaxAttempts
  • Constructor Details

    • FirstOnStackRetryPolicy

      public FirstOnStackRetryPolicy()
  • Method Details

    • canRetry

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

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

      public void close(org.springframework.retry.RetryContext context)
      Specified by:
      close in interface org.springframework.retry.RetryPolicy
      Overrides:
      close in class org.springframework.retry.policy.NeverRetryPolicy