Skip to content

Commit d9cc9e1

Browse files
committed
Merge pull request AsyncHttpClient#118 from bclozel/master
Implement Closeable interface for JDK7's "try-with-resources"
2 parents 8194daf + 21b7843 commit d9cc9e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/ning/http/client/AsyncHttpClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.ning.http.client.filter.RequestFilter;
2323
import com.ning.http.client.providers.jdk.JDKAsyncHttpProvider;
2424
import com.ning.http.client.resumable.ResumableAsyncHandler;
25+
import java.io.Closeable;
2526
import org.slf4j.Logger;
2627
import org.slf4j.LoggerFactory;
2728

@@ -138,7 +139,7 @@
138139
* An instance of this class will cache every HTTP 1.1 connections and close them when the {@link AsyncHttpClientConfig#getIdleConnectionTimeoutInMs()}
139140
* expires. This object can hold many persistent connections to different host.
140141
*/
141-
public class AsyncHttpClient {
142+
public class AsyncHttpClient implements Closeable {
142143

143144
private final static String DEFAULT_PROVIDER = "com.ning.http.client.providers.netty.NettyAsyncHttpProvider";
144145
private final AsyncHttpProvider httpProvider;

0 commit comments

Comments
 (0)