File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
main/java/org/springframework/core/retry
test/java/org/springframework/core/retry Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 32
32
import org .springframework .util .backoff .FixedBackOff ;
33
33
34
34
/**
35
- * A basic implementation of {@link RetryOperations} that invokes and potentially
35
+ * A basic implementation of {@link RetryOperations} that executes and potentially
36
36
* retries a {@link Retryable} operation based on a configured {@link RetryPolicy}
37
37
* and {@link BackOff} policy.
38
38
*
@@ -147,7 +147,7 @@ public void setRetryListener(RetryListener retryListener) {
147
147
// Initial attempt
148
148
try {
149
149
logger .debug (() -> "Preparing to execute retryable operation '%s'" .formatted (retryableName ));
150
- R result = retryable .run ();
150
+ R result = retryable .execute ();
151
151
logger .debug (() -> "Retryable operation '%s' completed successfully" .formatted (retryableName ));
152
152
return result ;
153
153
}
@@ -165,7 +165,7 @@ public void setRetryListener(RetryListener retryListener) {
165
165
logger .debug (() -> "Preparing to retry operation '%s'" .formatted (retryableName ));
166
166
try {
167
167
this .retryListener .beforeRetry (retryExecution );
168
- R result = retryable .run ();
168
+ R result = retryable .execute ();
169
169
this .retryListener .onRetrySuccess (retryExecution , result );
170
170
logger .debug (() -> "Retryable operation '%s' completed successfully after retry"
171
171
.formatted (retryableName ));
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public interface Retryable<R> {
36
36
* @return the result of the operation
37
37
* @throws Throwable if an error occurs during the execution of the operation
38
38
*/
39
- R run () throws Throwable ;
39
+ R execute () throws Throwable ;
40
40
41
41
/**
42
42
* A unique, logical name for this retryable operation, used to distinguish
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ void retryWithSuccess() throws Exception {
44
44
int failure ;
45
45
46
46
@ Override
47
- public String run () throws Exception {
47
+ public String execute () throws Exception {
48
48
if (failure ++ < 2 ) {
49
49
throw new Exception ("Error while invoking greeting service" );
50
50
}
@@ -68,7 +68,7 @@ void retryWithFailure() {
68
68
69
69
Retryable <String > retryable = new Retryable <>() {
70
70
@ Override
71
- public String run () throws Exception {
71
+ public String execute () throws Exception {
72
72
throw exception ;
73
73
}
74
74
@@ -100,7 +100,7 @@ public TechnicalException(String message) {
100
100
101
101
Retryable <String > retryable = new Retryable <>() {
102
102
@ Override
103
- public String run () throws TechnicalException {
103
+ public String execute () throws TechnicalException {
104
104
throw technicalException ;
105
105
}
106
106
You can’t perform that action at this time.
0 commit comments