org.apache.commons.httpclient

Class DefaultMethodRetryHandler

Implemented Interfaces:
MethodRetryHandler

public class DefaultMethodRetryHandler
extends Object
implements MethodRetryHandler

The default MethodRetryHandler used by HttpMethodBase.
See Also:
HttpMethodBase.setMethodRetryHandler(MethodRetryHandler)

Constructor Summary

DefaultMethodRetryHandler()

Method Summary

int
getRetryCount()
boolean
isRequestSentRetryEnabled()
boolean
retryMethod(HttpMethod method, HttpConnection connection, HttpRecoverableException recoverableException, int executionCount, boolean requestSent)
Used retryCount and requestSentRetryEnabled to determine if the given method should be retried.
void
setRequestSentRetryEnabled(boolean requestSentRetryEnabled)
void
setRetryCount(int retryCount)

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

DefaultMethodRetryHandler

public DefaultMethodRetryHandler()

Method Details

getRetryCount

public int getRetryCount()
Returns:
the maximum number of times a method will be retried

isRequestSentRetryEnabled

public boolean isRequestSentRetryEnabled()
Returns:
true if this handler will retry methods that have successfully sent their request, false otherwise

retryMethod

public boolean retryMethod(HttpMethod method,
                           HttpConnection connection,
                           HttpRecoverableException recoverableException,
                           int executionCount,
                           boolean requestSent)
Used retryCount and requestSentRetryEnabled to determine if the given method should be retried.
Specified by:
retryMethod in interface MethodRetryHandler

setRequestSentRetryEnabled

public void setRequestSentRetryEnabled(boolean requestSentRetryEnabled)
Parameters:
requestSentRetryEnabled - a flag indicating if methods that have successfully sent their request should be retried

setRetryCount

public void setRetryCount(int retryCount)
Parameters:
retryCount - the maximum number of times a method can be retried