File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed
api/src/main/java/com/ning/http/client Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .ning .http .client ;
17
17
18
+ import java .io .Closeable ;
18
19
import java .io .IOException ;
19
20
import java .util .List ;
20
21
21
22
/**
22
23
* Interface to be used when implementing custom asynchronous I/O HTTP client.
23
24
* By default, the {@link com.ning.http.client.providers.netty.NettyAsyncHttpProvider} is used.
24
25
*/
25
- public interface AsyncHttpProvider {
26
+ public interface AsyncHttpProvider extends Closeable {
26
27
27
28
/**
28
29
* Execute the request and invoke the {@link AsyncHandler} when the response arrive.
Original file line number Diff line number Diff line change 13
13
14
14
package com .ning .http .client ;
15
15
16
+ import java .io .Closeable ;
16
17
import java .io .IOException ;
17
18
import java .nio .ByteBuffer ;
18
19
19
20
/**
20
21
* A request body.
21
22
*/
22
- public interface Body {
23
+ public interface Body extends Closeable {
23
24
24
25
/**
25
26
* Gets the length of the body.
Original file line number Diff line number Diff line change 13
13
14
14
package com .ning .http .client ;
15
15
16
+ import java .io .Closeable ;
16
17
import java .io .IOException ;
17
18
import java .nio .ByteBuffer ;
18
19
19
20
/**
20
21
* A simple API to be used with the {@link SimpleAsyncHttpClient} class in order to process response's bytes.
21
22
*/
22
- public interface BodyConsumer {
23
+ public interface BodyConsumer extends Closeable {
23
24
24
25
/**
25
26
* Consume the received bytes.
Original file line number Diff line number Diff line change 20
20
import org .slf4j .LoggerFactory ;
21
21
22
22
import javax .net .ssl .SSLContext ;
23
+
24
+ import java .io .Closeable ;
23
25
import java .io .IOException ;
24
26
import java .util .Collection ;
25
27
import java .util .Map ;
57
59
* Future<Response> future = client.post(new FileodyGenerator(myFile), new OutputStreamBodyConsumer(o));
58
60
* </pre></blockquote>
59
61
*/
60
- public class SimpleAsyncHttpClient {
62
+ public class SimpleAsyncHttpClient implements Closeable {
61
63
62
64
private final static Logger logger = LoggerFactory .getLogger (SimpleAsyncHttpClient .class );
63
65
private final AsyncHttpClientConfig config ;
You can’t perform that action at this time.
0 commit comments