File tree Expand file tree Collapse file tree 3 files changed +21
-12
lines changed
spring-core/src/main/java/org/springframework/core/retry Expand file tree Collapse file tree 3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 2222/**
2323 * Exception thrown when a {@link RetryPolicy} has been exhausted.
2424 *
25+ * <p>A {@code RetryException} will contain the last exception thrown by the
26+ * {@link Retryable} operation as the {@linkplain #getCause() cause} and any
27+ * exceptions from previous attempts as {@linkplain #getSuppressed() suppressed
28+ * exceptions}.
29+ *
2530 * @author Mahmoud Ben Hassine
2631 * @since 7.0
2732 * @see RetryOperations
Original file line number Diff line number Diff line change 3434public interface RetryOperations {
3535
3636 /**
37- * Execute the given {@link Retryable} (according to the {@link RetryPolicy}
38- * configured at the implementation level) until it succeeds, or eventually
39- * throw an exception if the {@code RetryPolicy} is exhausted.
37+ * Execute the given {@link Retryable} operation according to the {@link RetryPolicy}
38+ * configured at the implementation level.
39+ * <p>If the {@code Retryable} succeeds, its result will be returned. Otherwise, a
40+ * {@link RetryException} will be thrown to the caller. The {@code RetryException}
41+ * will contain the last exception thrown by the {@code Retryable} operation as the
42+ * {@linkplain RetryException#getCause() cause} and any exceptions from previous
43+ * attempts as {@linkplain RetryException#getSuppressed() suppressed exceptions}.
4044 * @param retryable the {@code Retryable} to execute and retry if needed
4145 * @param <R> the type of the result
4246 * @return the result of the {@code Retryable}, if any
43- * @throws RetryException if the {@code RetryPolicy} is exhausted; exceptions
44- * encountered during retry attempts should be made available as suppressed
45- * exceptions
47+ * @throws RetryException if the {@code RetryPolicy} is exhausted
4648 */
4749 <R > @ Nullable R execute (Retryable <? extends @ Nullable R > retryable ) throws RetryException ;
4850
Original file line number Diff line number Diff line change @@ -104,15 +104,17 @@ public void setRetryListener(RetryListener retryListener) {
104104
105105
106106 /**
107- * Execute the supplied {@link Retryable} according to the configured retry
108- * and backoff policies.
109- * <p>If the {@code Retryable} succeeds, its result will be returned. Otherwise,
110- * a {@link RetryException} will be thrown to the caller.
107+ * Execute the supplied {@link Retryable} operation according to the configured
108+ * {@link RetryPolicy}.
109+ * <p>If the {@code Retryable} succeeds, its result will be returned. Otherwise, a
110+ * {@link RetryException} will be thrown to the caller. The {@code RetryException}
111+ * will contain the last exception thrown by the {@code Retryable} operation as the
112+ * {@linkplain RetryException#getCause() cause} and any exceptions from previous
113+ * attempts as {@linkplain RetryException#getSuppressed() suppressed exceptions}.
111114 * @param retryable the {@code Retryable} to execute and retry if needed
112115 * @param <R> the type of the result
113116 * @return the result of the {@code Retryable}, if any
114- * @throws RetryException if the {@code RetryPolicy} is exhausted; exceptions
115- * encountered during retry attempts are available as suppressed exceptions
117+ * @throws RetryException if the {@code RetryPolicy} is exhausted
116118 */
117119 @ Override
118120 public <R > @ Nullable R execute (Retryable <? extends @ Nullable R > retryable ) throws RetryException {
You can’t perform that action at this time.
0 commit comments