You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/05/09 20:02:05 UTC
[39/50] httpcomponents-core git commit: HTTPCORE-461: Add factory
methods to DefaultHttpServerIODispatch to handle a null SSLContext.
HTTPCORE-461: Add factory methods to DefaultHttpServerIODispatch to handle a null SSLContext.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.4.x@1793919 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/0ee4ac36
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/0ee4ac36
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/0ee4ac36
Branch: refs/heads/4.4.x
Commit: 0ee4ac36f7da00499a44aaa51a97a3f415871b46
Parents: 5ca20d3
Author: Gary D. Gregory <gg...@apache.org>
Authored: Thu May 4 22:42:10 2017 +0000
Committer: Gary D. Gregory <gg...@apache.org>
Committed: Thu May 4 22:42:10 2017 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 3 ++
.../impl/nio/DefaultHttpServerIODispatch.java | 38 +++++++++++++++++++-
2 files changed, 40 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/0ee4ac36/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 4a3ea93..a3c75af 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -12,6 +12,9 @@ Changelog
* HTTPCORE-460: Add factory methods to DefaultHttpClientIODispatch to handle a null SSLContext.
Contributed by Gary Gregory <ggregory at apache.org>
+* HTTPCORE-461: Add factory methods to DefaultHttpServerIODispatch 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/0ee4ac36/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpServerIODispatch.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpServerIODispatch.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpServerIODispatch.java
index a49b1b3..3a1621b 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpServerIODispatch.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultHttpServerIODispatch.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.NHttpConnectionFactory;
@@ -54,6 +54,42 @@ import org.apache.http.util.Args;
public class DefaultHttpServerIODispatch
extends AbstractIODispatch<DefaultNHttpServerConnection> {
+ /**
+ * 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 DefaultHttpServerIODispatch create(final NHttpServerEventHandler handler,
+ final SSLContext sslContext,
+ final ConnectionConfig config) {
+ return sslContext == null ? new DefaultHttpServerIODispatch(handler, config)
+ : new DefaultHttpServerIODispatch(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 DefaultHttpServerIODispatch create(final NHttpServerEventHandler handler,
+ final SSLContext sslContext,
+ final SSLSetupHandler sslHandler,
+ final ConnectionConfig config) {
+ return sslContext == null ? new DefaultHttpServerIODispatch(handler, config)
+ : new DefaultHttpServerIODispatch(handler, sslContext, sslHandler, config);
+ }
+
private final NHttpServerEventHandler handler;
private final NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connFactory;