hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1603755 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
Date Thu, 19 Jun 2014 08:28:40 GMT
Author: olegk
Date: Thu Jun 19 08:28:39 2014
New Revision: 1603755

URL: http://svn.apache.org/r1603755
Log:
HTTPCLIENT-1521: Added factory method for creation of main exec, which enables subclasses
of HttpClientBuilder to override the default implementation

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java?rev=1603755&r1=1603754&r2=1603755&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
Thu Jun 19 08:28:39 2014
@@ -701,6 +701,34 @@ public class HttpClientBuilder {
     }
 
     /**
+     * Produces an instance of {@link ClientExecChain} to be used as a main exec.
+     * <p>
+     * Default implementation produces an instance of {@link MainClientExec}
+     * <p>
+     * For internal use.
+     *
+     * @since 4.4
+     */
+    protected ClientExecChain createMainExec(
+            final HttpRequestExecutor requestExec,
+            final HttpClientConnectionManager connManager,
+            final ConnectionReuseStrategy reuseStrategy,
+            final ConnectionKeepAliveStrategy keepAliveStrategy,
+            final AuthenticationStrategy targetAuthStrategy,
+            final AuthenticationStrategy proxyAuthStrategy,
+            final UserTokenHandler userTokenHandler)
+    {
+        return new MainClientExec(
+                requestExec,
+                connManager,
+                reuseStrategy,
+                keepAliveStrategy,
+                targetAuthStrategy,
+                proxyAuthStrategy,
+                userTokenHandler);
+    }
+
+    /**
      * For internal use.
      */
     protected ClientExecChain decorateMainExec(final ClientExecChain mainExec) {
@@ -835,7 +863,7 @@ public class HttpClientBuilder {
                 userTokenHandlerCopy = NoopUserTokenHandler.INSTANCE;
             }
         }
-        ClientExecChain execChain = new MainClientExec(
+        ClientExecChain execChain = createMainExec(
                 requestExecCopy,
                 connManagerCopy,
                 reuseStrategyCopy,



Mime
View raw message