hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [07/19] httpcomponents-core git commit: HTTPCORE-460: Add factory methods to DefaultHttpClientIODispatch to handle a null SSLContext.
Date Fri, 12 May 2017 08:04:31 GMT
HTTPCORE-460: Add factory methods to DefaultHttpClientIODispatch to handle a null SSLContext.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.4.x@1793918
13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/31edd6e6
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/31edd6e6
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/31edd6e6

Branch: refs/heads/4.4.x
Commit: 31edd6e638b6d8efe9a0a75f3e88298f47d697f4
Parents: 1201300
Author: Gary D. Gregory <ggregory@apache.org>
Authored: Thu May 4 22:41:22 2017 +0000
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Fri May 12 09:48:14 2017 +0200

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |  3 ++
 .../impl/nio/DefaultHttpClientIODispatch.java   | 38 +++++++++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/31edd6e6/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 46173c4..4a3ea93 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -9,6 +9,9 @@ Changelog
 * HTTPCORE-450: Add a Provider parameter in SSLContextBuilder.
   Contributed by lujianbo <387852424 at qq dot com>, Gary Gregory <ggregory at apache.org>
 
+* HTTPCORE-460: Add factory methods to DefaultHttpClientIODispatch to handle a null SSLContext.
+  Contributed by Gary Gregory <ggregory at apache.org>
+
 
 Release 4.4.6
 -------------------

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/31edd6e6/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpClientIODispatch.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpClientIODispatch.java
b/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpClientIODispatch.java
index cfc0a10..44935b0 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpClientIODispatch.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpClientIODispatch.java
@@ -31,8 +31,8 @@ import java.io.IOException;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.http.annotation.ThreadingBehavior;
 import org.apache.http.annotation.Contract;
+import org.apache.http.annotation.ThreadingBehavior;
 import org.apache.http.config.ConnectionConfig;
 import org.apache.http.impl.nio.reactor.AbstractIODispatch;
 import org.apache.http.nio.NHttpClientEventHandler;
@@ -54,6 +54,42 @@ import org.apache.http.util.Args;
 public class DefaultHttpClientIODispatch
                     extends AbstractIODispatch<DefaultNHttpClientConnection> {
 
+    /**
+     * Creates a new instance of this class to be used for dispatching I/O event
+     * notifications to the given protocol handler.
+     *
+     * @param handler the client protocol handler.
+     * @param sslContext an SSLContext or null (for a plain text connection.)
+     * @param config a connection configuration
+     * @return a new instance
+     * @since 4.4.7
+     */
+    public static DefaultHttpClientIODispatch create(final NHttpClientEventHandler handler,
+            final SSLContext sslContext,
+            final ConnectionConfig config) {
+        return sslContext == null ? new DefaultHttpClientIODispatch(handler, config)
+                : new DefaultHttpClientIODispatch(handler, sslContext, config);
+    }
+
+    /**
+     * Creates a new instance of this class to be used for dispatching I/O event
+     * notifications to the given protocol handler.
+     *
+     * @param handler the client protocol handler.
+     * @param sslContext an SSLContext or null (for a plain text connection.)
+     * @param sslHandler customizes various aspects of the TLS/SSL protocol.
+     * @param config a connection configuration
+     * @return a new instance
+     * @since 4.4.7
+     */
+    public static DefaultHttpClientIODispatch create(final NHttpClientEventHandler handler,
+            final SSLContext sslContext,
+            final SSLSetupHandler sslHandler,
+            final ConnectionConfig config) {
+        return sslContext == null ? new DefaultHttpClientIODispatch(handler, config)
+                : new DefaultHttpClientIODispatch(handler, sslContext, sslHandler, config);
+    }
+
     private final NHttpClientEventHandler handler;
     private final NHttpConnectionFactory<DefaultNHttpClientConnection> connFactory;
 


Mime
View raw message