Interface RetryOperations

All Known Implementing Classes:
RetryTemplate

public interface RetryOperations
Interface specifying basic retry operations.

Implemented by RetryTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Inspired by the Spring Retry project but redesigned as a minimal core retry feature in the Spring Framework.

Since:
7.0
Author:
Mahmoud Ben Hassine
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    <R> @Nullable R
    execute(Retryable<? extends @Nullable R> retryable)
    Execute the given Retryable (according to the RetryPolicy configured at the implementation level) until it succeeds, or eventually throw an exception if the RetryPolicy is exhausted.
  • Method Details

    • execute

      <R> @Nullable R execute(Retryable<? extends @Nullable R> retryable) throws RetryException
      Execute the given Retryable (according to the RetryPolicy configured at the implementation level) until it succeeds, or eventually throw an exception if the RetryPolicy is exhausted.
      Type Parameters:
      R - the type of the result
      Parameters:
      retryable - the Retryable to execute and retry if needed
      Returns:
      the result of the Retryable, if any
      Throws:
      RetryException - if the RetryPolicy is exhausted; exceptions encountered during retry attempts should be made available as suppressed exceptions