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 1515 */
1616package com .ning .http .client ;
1717
18+ import java .io .Closeable ;
1819import java .io .IOException ;
1920import java .util .List ;
2021
2122/**
2223 * Interface to be used when implementing custom asynchronous I/O HTTP client.
2324 * By default, the {@link com.ning.http.client.providers.netty.NettyAsyncHttpProvider} is used.
2425 */
25- public interface AsyncHttpProvider {
26+ public interface AsyncHttpProvider extends Closeable {
2627
2728 /**
2829 * Execute the request and invoke the {@link AsyncHandler} when the response arrive.
Original file line number Diff line number Diff line change 1313
1414package com .ning .http .client ;
1515
16+ import java .io .Closeable ;
1617import java .io .IOException ;
1718import java .nio .ByteBuffer ;
1819
1920/**
2021 * A request body.
2122 */
22- public interface Body {
23+ public interface Body extends Closeable {
2324
2425 /**
2526 * Gets the length of the body.
Original file line number Diff line number Diff line change 1313
1414package com .ning .http .client ;
1515
16+ import java .io .Closeable ;
1617import java .io .IOException ;
1718import java .nio .ByteBuffer ;
1819
1920/**
2021 * A simple API to be used with the {@link SimpleAsyncHttpClient} class in order to process response's bytes.
2122 */
22- public interface BodyConsumer {
23+ public interface BodyConsumer extends Closeable {
2324
2425 /**
2526 * Consume the received bytes.
Original file line number Diff line number Diff line change 2020import org .slf4j .LoggerFactory ;
2121
2222import javax .net .ssl .SSLContext ;
23+
24+ import java .io .Closeable ;
2325import java .io .IOException ;
2426import java .util .Collection ;
2527import java .util .Map ;
5759 * Future<Response> future = client.post(new FileodyGenerator(myFile), new OutputStreamBodyConsumer(o));
5860 * </pre></blockquote>
5961 */
60- public class SimpleAsyncHttpClient {
62+ public class SimpleAsyncHttpClient implements Closeable {
6163
6264 private final static Logger logger = LoggerFactory .getLogger (SimpleAsyncHttpClient .class );
6365 private final AsyncHttpClientConfig config ;
You can’t perform that action at this time.
0 commit comments