Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C87D9200C7F for ; Tue, 9 May 2017 22:01:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C75FB160BB6; Tue, 9 May 2017 20:01:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EE9C9160BD0 for ; Tue, 9 May 2017 22:01:29 +0200 (CEST) Received: (qmail 78317 invoked by uid 500); 9 May 2017 20:01:28 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 77227 invoked by uid 99); 9 May 2017 20:01:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2017 20:01:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 49ECCDFD70; Tue, 9 May 2017 20:01:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: olegk@apache.org To: commits@hc.apache.org Date: Tue, 09 May 2017 20:02:05 -0000 Message-Id: <1e5a0b5828354d8cb8b463c5129185d8@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [39/50] httpcomponents-core git commit: HTTPCORE-461: Add factory methods to DefaultHttpServerIODispatch to handle a null SSLContext. archived-at: Tue, 09 May 2017 20:01:33 -0000 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 Authored: Thu May 4 22:42:10 2017 +0000 Committer: Gary D. Gregory 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 +* HTTPCORE-461: Add factory methods to DefaultHttpServerIODispatch to handle a null SSLContext. + Contributed by Gary Gregory + 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 { + /** + * 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 connFactory;