org.apache.commons.httpclient

Class DefaultHttpMethodRetryHandler

public class DefaultHttpMethodRetryHandler extends Object implements HttpMethodRetryHandler

The default {@link HttpMethodRetryHandler} used by {@link HttpMethod}s.

Author: Michael Becke Oleg Kalnichevski

Constructor Summary
DefaultHttpMethodRetryHandler(int retryCount, boolean requestSentRetryEnabled)
Creates a new DefaultHttpMethodRetryHandler.
DefaultHttpMethodRetryHandler()
Creates a new DefaultHttpMethodRetryHandler that retries up to 3 times but does not retry methods that have successfully sent their requests.
Method Summary
intgetRetryCount()
booleanisRequestSentRetryEnabled()
booleanretryMethod(HttpMethod method, IOException exception, int executionCount)
Used retryCount and requestSentRetryEnabled to determine if the given method should be retried.

Constructor Detail

DefaultHttpMethodRetryHandler

public DefaultHttpMethodRetryHandler(int retryCount, boolean requestSentRetryEnabled)
Creates a new DefaultHttpMethodRetryHandler.

Parameters: retryCount the number of times a method will be retried requestSentRetryEnabled if true, methods that have successfully sent their request will be retried

DefaultHttpMethodRetryHandler

public DefaultHttpMethodRetryHandler()
Creates a new DefaultHttpMethodRetryHandler that retries up to 3 times but does not retry methods that have successfully sent their requests.

Method Detail

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, IOException exception, int executionCount)
Used retryCount and requestSentRetryEnabled to determine if the given method should be retried.

See Also: HttpMethodRetryHandler

Copyright (c) 1999-2005 - Apache Software Foundation