public class DelegatingRetryingCallable<T,D extends RetryingCallable<T>> extends Object implements RetryingCallable<T>
| Constructor and Description |
|---|
DelegatingRetryingCallable(D delegate) |
| Modifier and Type | Method and Description |
|---|---|
T |
call() |
String |
getExceptionMessageAdditionalDetail() |
void |
prepare(boolean reload)
Prepare by setting up any connections to servers, etc., ahead of
Callable.call() invocation. |
long |
sleep(long pause,
int tries) |
void |
throwable(Throwable t,
boolean retrying)
Called when
Callable.call() throws an exception and we are going to retry; take action to
make it so we succeed on next call (clear caches, do relookup of locations, etc.). |
protected final D extends RetryingCallable<T> delegate
public DelegatingRetryingCallable(D delegate)
public void prepare(boolean reload)
throws IOException
RetryingCallableCallable.call() invocation.prepare in interface RetryingCallable<T>reload - Set this to true if need to requery locations (usually set on second invocation
to Callable.call() or whateverIOException - epublic void throwable(Throwable t, boolean retrying)
RetryingCallableCallable.call() throws an exception and we are going to retry; take action to
make it so we succeed on next call (clear caches, do relookup of locations, etc.).throwable in interface RetryingCallable<T>retrying - True if we are in retrying mode (we are not in retrying mode when max
retries == 1; we ARE in retrying mode if retries > 1 even when we are the last attempt)public String getExceptionMessageAdditionalDetail()
getExceptionMessageAdditionalDetail in interface RetryingCallable<T>public long sleep(long pause,
int tries)
sleep in interface RetryingCallable<T>Copyright © 2014 The Apache Software Foundation. All rights reserved.