Class RetryTask<V extends @Nullable Object, E extends Exception>

java.lang.Object
org.springframework.core.retry.support.RetryTask<V,E>
Type Parameters:
V - the returned value type, if any
E - the exception propagated, if any
All Implemented Interfaces:
Callable<V>, TaskCallback<V,E>

public class RetryTask<V extends @Nullable Object, E extends Exception> extends Object implements TaskCallback<V,E>
A TaskCallback that executes a given retryable task, re-executing it after failure according to a retry policy. Inherits Callable through TaskCallback.

For regular construction, this is designed to match the SyncTaskExecutor.execute(TaskCallback) signature for propagating specific exception types but is also usable with the Callback-based methods on AsyncTaskExecutor.

Alternatively, this class can also be used to wrap a given Callable or Runnable into corresponding retrying variants: see the common static wrap methods. This is particularly useful for existing Callable and Runnable classes, as well as for scheduling methods which typically accept a Runnable in their signature.

Since:
7.0.4
Author:
Juergen Hoeller
See Also: