Interface Retryable<R>

Type Parameters:
R - the type of the result
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Retryable<R>
Retryable is a functional interface that can be used to implement any generic block of code that can potentially be retried.

Used in conjunction with RetryOperations.

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

    Modifier and Type
    Method
    Description
    Method to execute and retry if needed.
    default String
    A unique, logical name for this retryable operation, used to distinguish between retries for different business operations.
  • Method Details

    • execute

      @Nullable R execute() throws Throwable
      Method to execute and retry if needed.
      Returns:
      the result of the operation
      Throws:
      Throwable - if an error occurs during the execution of the operation
    • getName

      default String getName()
      A unique, logical name for this retryable operation, used to distinguish between retries for different business operations.

      Defaults to the fully-qualified class name of the implementation class.

      Returns:
      the name of this retryable operation