Package org.docx4j.services.client
Class MyRetryHandler
java.lang.Object
org.docx4j.services.client.MyRetryHandler
- All Implemented Interfaces:
org.apache.http.client.HttpRequestRetryHandler
public class MyRetryHandler
extends java.lang.Object
implements org.apache.http.client.HttpRequestRetryHandler
-
Field Summary
Fields Modifier and Type Field Description static MyRetryHandlerINSTANCE -
Constructor Summary
Constructors Modifier Constructor Description MyRetryHandler()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 SSLExceptionMyRetryHandler(int retryCount, boolean requestSentRetryEnabled)Create the request retry handler using the following list of non-retriable IOException classes:
InterruptedIOException UnknownHostException ConnectException SSLExceptionprotectedMyRetryHandler(int retryCount, boolean requestSentRetryEnabled, java.util.Collection<java.lang.Class<? extends java.io.IOException>> clazzes)Create the request retry handler using the specified IOException classes -
Method Summary
Modifier and Type Method Description intgetRetryCount()protected booleanhandleAsIdempotent(org.apache.http.HttpRequest request)booleanisRequestSentRetryEnabled()protected booleanrequestIsAborted(org.apache.http.HttpRequest request)Deprecated.(4.3)booleanretryRequest(java.io.IOException exception, int executionCount, org.apache.http.protocol.HttpContext context)UsedretryCountandrequestSentRetryEnabledto determine if the given method should be retried.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
MyRetryHandler
protected MyRetryHandler(int retryCount, boolean requestSentRetryEnabled, java.util.Collection<java.lang.Class<? extends java.io.IOException>> clazzes)Create the request retry handler using the specified IOException classes- Parameters:
retryCount- how many times to retry; 0 means no retriesrequestSentRetryEnabled- true if it's OK to retry requests that have been sentclazzes- the IOException types that should not be retried- Since:
- 4.3
-
MyRetryHandler
public MyRetryHandler(int retryCount, boolean requestSentRetryEnabled)Create the request retry handler using the following list of non-retriable IOException classes:
- InterruptedIOException
- UnknownHostException
- ConnectException
- SSLException
- Parameters:
retryCount- how many times to retry; 0 means no retriesrequestSentRetryEnabled- true if it's OK to retry requests that have been sent
-
MyRetryHandler
public MyRetryHandler()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
-
-
Method Details
-
retryRequest
public boolean retryRequest(java.io.IOException exception, int executionCount, org.apache.http.protocol.HttpContext context)UsedretryCountandrequestSentRetryEnabledto determine if the given method should be retried.- Specified by:
retryRequestin interfaceorg.apache.http.client.HttpRequestRetryHandler
-
isRequestSentRetryEnabled
public boolean isRequestSentRetryEnabled()- Returns:
trueif this handler will retry methods that have successfully sent their request,falseotherwise
-
getRetryCount
public int getRetryCount()- Returns:
- the maximum number of times a method will be retried
-
handleAsIdempotent
protected boolean handleAsIdempotent(org.apache.http.HttpRequest request)- Since:
- 4.2
-
requestIsAborted
@Deprecated protected boolean requestIsAborted(org.apache.http.HttpRequest request)Deprecated.(4.3)- Since:
- 4.2
-