|
8 | 8 | import com.google.common.collect.ImmutableList; |
9 | 9 | import com.google.common.collect.ImmutableSet; |
10 | 10 | import com.google.common.collect.Sets; |
11 | | -import com.google.gcloud.ExceptionHandler.Interceptor.RetryResult; |
12 | 11 |
|
13 | 12 | import java.io.Serializable; |
14 | 13 | import java.lang.reflect.Method; |
@@ -140,10 +139,10 @@ static final class RetryInfo implements Serializable { |
140 | 139 |
|
141 | 140 | private static final long serialVersionUID = -4264634837841455974L; |
142 | 141 | private final Class<? extends Exception> exception; |
143 | | - private final RetryResult retry; |
| 142 | + private final Interceptor.RetryResult retry; |
144 | 143 | private final Set<RetryInfo> children = Sets.newHashSet(); |
145 | 144 |
|
146 | | - RetryInfo(Class<? extends Exception> exception, RetryResult retry) { |
| 145 | + RetryInfo(Class<? extends Exception> exception, Interceptor.RetryResult retry) { |
147 | 146 | this.exception = checkNotNull(exception); |
148 | 147 | this.retry = retry; |
149 | 148 | } |
@@ -174,10 +173,10 @@ private ExceptionHandler(Builder builder) { |
174 | 173 | Sets.intersection(retriableExceptions, nonRetriableExceptions).isEmpty(), |
175 | 174 | "Same exception was found in both retriable and non-retriable sets"); |
176 | 175 | for (Class<? extends Exception> exception : retriableExceptions) { |
177 | | - addToRetryInfos(retryInfos, new RetryInfo(exception, RetryResult.RETRY)); |
| 176 | + addToRetryInfos(retryInfos, new RetryInfo(exception, Interceptor.RetryResult.RETRY)); |
178 | 177 | } |
179 | 178 | for (Class<? extends Exception> exception : nonRetriableExceptions) { |
180 | | - addToRetryInfos(retryInfos, new RetryInfo(exception, RetryResult.ABORT)); |
| 179 | + addToRetryInfos(retryInfos, new RetryInfo(exception, Interceptor.RetryResult.ABORT)); |
181 | 180 | } |
182 | 181 | } |
183 | 182 |
|
@@ -242,13 +241,14 @@ public Set<Class<? extends Exception>> getNonRetriableExceptions() { |
242 | 241 |
|
243 | 242 | boolean shouldRetry(Exception ex) { |
244 | 243 | for (Interceptor interceptor : interceptors) { |
245 | | - RetryResult retryResult = interceptor.shouldRetry(ex); |
| 244 | + Interceptor.RetryResult retryResult = interceptor.shouldRetry(ex); |
246 | 245 | if (retryResult != null) { |
247 | 246 | return retryResult.booleanValue(); |
248 | 247 | } |
249 | 248 | } |
250 | 249 | RetryInfo retryInfo = findMostSpecificRetryInfo(retryInfos, ex.getClass()); |
251 | | - RetryResult retryResult = retryInfo == null ? RetryResult.ABORT : retryInfo.retry; |
| 250 | + Interceptor.RetryResult retryResult = |
| 251 | + retryInfo == null ? Interceptor.RetryResult.ABORT : retryInfo.retry; |
252 | 252 | for (Interceptor interceptor : interceptors) { |
253 | 253 | retryResult = firstNonNull(interceptor.shouldRetry(ex, retryResult), retryResult); |
254 | 254 | } |
|
0 commit comments