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 import java.io.IOException;
33
34 /***
35 * A handler for determining if an HttpMethod should be retried after a
36 * recoverable exception during execution.
37 *
38 * <p>
39 * Classes implementing this interface must synchronize access to shared
40 * data as methods of this interfrace may be executed from multiple threads
41 * </p>
42 *
43 * @see HttpMethod#execute(HttpState, HttpConnection)
44 * @see HttpRecoverableException
45 *
46 * @author Michael Becke
47 * @author <a href="mailto:oleg -at- ural.ru">Oleg Kalnichevski</a>
48 */
49 public interface HttpMethodRetryHandler {
50
51 /***
52 * Determines if a method should be retried after an HttpRecoverableException
53 * occurs during execution.
54 *
55 * @param method the method being executed
56 * @param exception the exception that occurred
57 * @param executionCount the number of times this method has been
58 * unsuccessfully executed
59 *
60 * @return <code>true</code> if the method should be retried, <code>false</code>
61 * otherwise
62 */
63 boolean retryMethod(HttpMethod method, IOException exception, int executionCount);
64
65 }