hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1723805 - in /httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client: HttpAsyncClientBuilder.java IOReactorUtils.java MinimalHttpAsyncClientBuilder.java
Date Fri, 08 Jan 2016 21:40:45 GMT
Author: olegk
Date: Fri Jan  8 21:40:45 2016
New Revision: 1723805

URL: http://svn.apache.org/viewvc?rev=1723805&view=rev
Log:
HttpAsyncClient builder to pass custom ThreadFactory to the DefaultConnectingIOReactor constructor

Modified:
    httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
    httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/IOReactorUtils.java
    httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalHttpAsyncClientBuilder.java

Modified: httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java?rev=1723805&r1=1723804&r2=1723805&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
(original)
+++ httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
Fri Jan  8 21:40:45 2016
@@ -666,7 +666,7 @@ public class HttpAsyncClientBuilder {
                         sslcontext, supportedProtocols, supportedCipherSuites, hostnameVerifier);
             }
             final ConnectingIOReactor ioreactor = IOReactorUtils.create(
-                defaultIOReactorConfig != null ? defaultIOReactorConfig : IOReactorConfig.DEFAULT);
+                defaultIOReactorConfig != null ? defaultIOReactorConfig : IOReactorConfig.DEFAULT,
threadFactory);
             final PoolingNHttpClientConnectionManager poolingmgr = new PoolingNHttpClientConnectionManager(
                     ioreactor,
                     RegistryBuilder.<SchemeIOSessionStrategy>create()

Modified: httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/IOReactorUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/IOReactorUtils.java?rev=1723805&r1=1723804&r2=1723805&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/IOReactorUtils.java
(original)
+++ httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/IOReactorUtils.java
Fri Jan  8 21:40:45 2016
@@ -26,6 +26,8 @@
  */
 package org.apache.http.impl.nio.client;
 
+import java.util.concurrent.ThreadFactory;
+
 import org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor;
 import org.apache.http.impl.nio.reactor.IOReactorConfig;
 import org.apache.http.nio.reactor.ConnectingIOReactor;
@@ -36,9 +38,9 @@ final class IOReactorUtils {
     private IOReactorUtils() {
     }
 
-    public static ConnectingIOReactor create(final IOReactorConfig config) {
+    public static ConnectingIOReactor create(final IOReactorConfig config, final ThreadFactory
threadFactory) {
         try {
-            return new DefaultConnectingIOReactor(config);
+            return new DefaultConnectingIOReactor(config, threadFactory);
         } catch (final IOReactorException ex) {
             throw new IllegalStateException(ex);
         }

Modified: httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalHttpAsyncClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalHttpAsyncClientBuilder.java?rev=1723805&r1=1723804&r2=1723805&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalHttpAsyncClientBuilder.java
(original)
+++ httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalHttpAsyncClientBuilder.java
Fri Jan  8 21:40:45 2016
@@ -117,8 +117,8 @@ class MinimalHttpAsyncClientBuilder {
 
         NHttpClientConnectionManager connManager = this.connManager;
         if (connManager == null) {
-            connManager = new PoolingNHttpClientConnectionManager(
-                    IOReactorUtils.create(IOReactorConfig.DEFAULT));
+            connManager = new PoolingNHttpClientConnectionManager(IOReactorUtils.create(IOReactorConfig.DEFAULT,
+                    threadFactory));
         }
         ConnectionReuseStrategy reuseStrategy = this.reuseStrategy;
         if (reuseStrategy == null) {



Mime
View raw message