[go: nahoru, domu]

Skip to content

Commit

Permalink
Improve setNumberOfRetries comment
Browse files Browse the repository at this point in the history
  • Loading branch information
peleyal committed May 23, 2013
1 parent 316c2d4 commit 48aa083
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ static String executeAndGetValueOfSomeCustomHeader(HttpRequest request) {
private HttpHeaders responseHeaders = new HttpHeaders();

/**
* Set the number of retries that will be allowed to execute as the result of an
* {@link HttpUnsuccessfulResponseHandler} before being terminated or {@code 0} to not retry
* requests. The default value is {@code 10}.
* The number of retries that will be allowed to execute before the request will be terminated or
* {@code 0} to not retry requests. Retries occur as a result of either
* {@link HttpUnsuccessfulResponseHandler} or {@link HttpIOExceptionHandler} which handles
* abnormal HTTP response or the I/O exception.
*/
private int numRetries = 10;

Expand Down Expand Up @@ -626,9 +627,11 @@ public HttpRequest setResponseInterceptor(HttpResponseInterceptor responseInterc
}

/**
* Returns the number of retries that will be allowed to execute as the result of an
* {@link HttpUnsuccessfulResponseHandler} before being terminated or {@code 0} to not retry
* requests.
* Returns the number of retries that will be allowed to execute before the request will be
* terminated or {@code 0} to not retry requests. Retries occur as a result of either
* {@link HttpUnsuccessfulResponseHandler} or {@link HttpIOExceptionHandler} which handles
* abnormal HTTP response or the I/O exception.
*
*
* @since 1.5
*/
Expand All @@ -637,9 +640,10 @@ public int getNumberOfRetries() {
}

/**
* Returns the number of retries that will be allowed to execute as the result of an
* {@link HttpUnsuccessfulResponseHandler} before being terminated or {@code 0} to not retry
* requests.
* Sets the number of retries that will be allowed to execute before the request will be
* terminated or {@code 0} to not retry requests. Retries occur as a result of either
* {@link HttpUnsuccessfulResponseHandler} or {@link HttpIOExceptionHandler} which handles
* abnormal HTTP response or the I/O exception.
*
* <p>
* The default value is {@code 10}.
Expand Down Expand Up @@ -969,9 +973,8 @@ public HttpResponse execute() throws IOException {
}
}
} catch (IOException e) {
if (!retryOnExecuteIOException
&& (ioExceptionHandler == null ||
!ioExceptionHandler.handleIOException(this, retryRequest))) {
if (!retryOnExecuteIOException && (ioExceptionHandler == null
|| !ioExceptionHandler.handleIOException(this, retryRequest))) {
throw e;
}
// Save the exception in case the retries do not work and we need to re-throw it later.
Expand Down

0 comments on commit 48aa083

Please sign in to comment.