@Contract(threading=STATELESS) public class DefaultHttpRequestRetryHandler extends Object implements HttpRequestRetryHandler
HttpRequestRetryHandler used by request executors.| Modifier and Type | Field and Description |
|---|---|
static DefaultHttpRequestRetryHandler |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
|
DefaultHttpRequestRetryHandler()
Create the request retry handler with a retry count of 3, requestSentRetryEnabled false
and using the following list of non-retriable IOException classes:
InterruptedIOException UnknownHostException ConnectException SSLException |
|
DefaultHttpRequestRetryHandler(int retryCount)
Create the request retry handler using the following list of
non-retriable IOException classes:
InterruptedIOException UnknownHostException ConnectException SSLException |
protected |
DefaultHttpRequestRetryHandler(int retryCount,
Class<? extends IOException>... clazzes)
Create the request retry handler using the specified IOException classes
|
| Modifier and Type | Method and Description |
|---|---|
int |
getRetryCount() |
protected boolean |
handleAsIdempotent(org.apache.hc.core5.http.HttpRequest request) |
boolean |
retryRequest(org.apache.hc.core5.http.HttpRequest request,
IOException exception,
int executionCount,
org.apache.hc.core5.http.protocol.HttpContext context)
Used
retryCount and requestSentRetryEnabled to determine
if the given method should be retried. |
public static final DefaultHttpRequestRetryHandler INSTANCE
@SafeVarargs protected DefaultHttpRequestRetryHandler(int retryCount, Class<? extends IOException>... clazzes)
retryCount - how many times to retry; 0 means no retriesclazzes - the IOException types that should not be retriedpublic DefaultHttpRequestRetryHandler(int retryCount)
retryCount - how many times to retry; 0 means no retriespublic DefaultHttpRequestRetryHandler()
public boolean retryRequest(org.apache.hc.core5.http.HttpRequest request,
IOException exception,
int executionCount,
org.apache.hc.core5.http.protocol.HttpContext context)
retryCount and requestSentRetryEnabled to determine
if the given method should be retried.retryRequest in interface HttpRequestRetryHandlerrequest - request failed die to an I/O exception.exception - the exception that occurredexecutionCount - the number of times this method has been
unsuccessfully executedcontext - the context for the request executiontrue if the method should be retried, false
otherwisepublic int getRetryCount()
protected boolean handleAsIdempotent(org.apache.hc.core5.http.HttpRequest request)
Copyright © 1999–2018 The Apache Software Foundation. All rights reserved.