diff --git a/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java b/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java index c76bfa68d..b2cc3a6f0 100644 --- a/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java +++ b/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java @@ -58,6 +58,12 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingClientConnectionManager; import org.apache.http.protocol.BasicHttpContext; +/** + * An Executor for fluent requests + *
+ * A {@link PoolingClientConnectionManager} with maximum 100 connections per route and + * a total maximum of 200 connections is used internally. + */ public class Executor { final static PoolingClientConnectionManager CONNMGR; @@ -178,6 +184,14 @@ public class Executor { return this; } + /** + * Executes the request. Please Note that response content must be processed + * or discarded using {@link Response#discardContent()}, otherwise the + * connection used for the request might not be released to the pool. + * + * @see Response#handleResponse(org.apache.http.client.ResponseHandler) + * @see Response#discardContent() + */ public Response execute( final Request request) throws ClientProtocolException, IOException { this.localContext.setAttribute(ClientContext.CREDS_PROVIDER, this.credentialsProvider); diff --git a/fluent-hc/src/main/java/org/apache/http/client/fluent/Response.java b/fluent-hc/src/main/java/org/apache/http/client/fluent/Response.java index 3d7345bf6..946a6f2de 100644 --- a/fluent-hc/src/main/java/org/apache/http/client/fluent/Response.java +++ b/fluent-hc/src/main/java/org/apache/http/client/fluent/Response.java @@ -68,10 +68,16 @@ public class Response { } } + /** + * Discards response content and deallocates all resources associated with it. + */ public void discardContent() { dispose(); } + /** + * Handles the response using the specified {@link ResponseHandler} + */ public