1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package org.apache.commons.httpclient;
31
32 /***
33 * A handler for determining if an HttpMethod should be retried after a
34 * recoverable exception during execution.
35 *
36 * @see HttpMethod#execute(HttpState, HttpConnection)
37 * @see HttpRecoverableException
38 *
39 * @author Michael Becke
40 */
41 public interface MethodRetryHandler {
42
43 /***
44 * Determines if a method should be retried after an HttpRecoverableException
45 * occurs during execution.
46 *
47 * @param method the method being executed
48 * @param connection the connection the method is using
49 * @param recoverableException the exception that occurred
50 * @param executionCount the number of times this method has been
51 * unsuccessfully executed
52 * @param requestSent a flag indicating if the request has been fully sent or not
53 *
54 * @return <code>true</code> if the method should be retried, <code>false</code>
55 * otherwise
56 */
57 boolean retryMethod(
58 HttpMethod method,
59 HttpConnection connection,
60 HttpRecoverableException recoverableException,
61 int executionCount,
62 boolean requestSent);
63
64 }