You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2018/01/06 18:57:48 UTC

httpcomponents-core git commit: [HTTPCORE-503] Add APIs to DefaultHttpClientIODispatch to get its connection factory and handler.

Repository: httpcomponents-core
Updated Branches:
  refs/heads/4.4.x 688b53d03 -> f1c5d6c56


[HTTPCORE-503] Add APIs to DefaultHttpClientIODispatch to get its
connection factory and handler.

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

Branch: refs/heads/4.4.x
Commit: f1c5d6c5631f0d4a5109ffff4ae3f2234c7c441c
Parents: 688b53d
Author: Gary Gregory <gg...@apache.org>
Authored: Sat Jan 6 11:57:45 2018 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Sat Jan 6 11:57:45 2018 -0700

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |  3 +++
 .../impl/nio/DefaultHttpClientIODispatch.java   | 26 +++++++++++++++++---
 2 files changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f1c5d6c5/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 316a6ef..d9563be 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -21,6 +21,9 @@ Changelog
 * HTTPCORE-502: Add APIs to DefaultHttpServerIODispatch to get its connection factory and handler.
   Contributed by Gary Gregory <ggregory at apache.org>
 
+* HTTPCORE-503: Add APIs to DefaultHttpClientIODispatch to get its connection factory and handler.
+  Contributed by Gary Gregory <ggregory at apache.org>
+
 * HTTPCORE-504: Update DefaultHttpClientIODispatch constructor to type for subclasses of DefaultNHttpClientConnection (like DefaultHttpServerIODispatch.)
   Contributed by Gary Gregory <ggregory at apache.org>
 

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f1c5d6c5/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 9a8e8e5..eb6f0e6 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
@@ -91,7 +91,7 @@ public class DefaultHttpClientIODispatch
     }
 
     private final NHttpClientEventHandler handler;
-    private final NHttpConnectionFactory<? extends DefaultNHttpClientConnection> connFactory;
+    private final NHttpConnectionFactory<? extends DefaultNHttpClientConnection> connectionFactory;
 
     /**
      * Creates a new instance of this class to be used for dispatching I/O event
@@ -105,7 +105,7 @@ public class DefaultHttpClientIODispatch
             final NHttpConnectionFactory<? extends DefaultNHttpClientConnection> connFactory) {
         super();
         this.handler = Args.notNull(handler, "HTTP client handler");
-        this.connFactory = Args.notNull(connFactory, "HTTP client connection factory");
+        this.connectionFactory = Args.notNull(connFactory, "HTTP client connection factory");
     }
 
     /**
@@ -174,7 +174,27 @@ public class DefaultHttpClientIODispatch
 
     @Override
     protected DefaultNHttpClientConnection createConnection(final IOSession session) {
-        return this.connFactory.createConnection(session);
+        return this.connectionFactory.createConnection(session);
+    }
+
+    /**
+     * Gets the connection factory used to construct this dispatch.
+     *
+     * @return the connection factory used to construct this dispatch.
+     * @since 4.4.9
+     */
+    public NHttpConnectionFactory<? extends DefaultNHttpClientConnection> getConnectionFactory() {
+        return connectionFactory;
+    }
+
+    /**
+     * Gets the handler used to construct this dispatch.
+     *
+     * @return the handler used to construct this dispatch.
+     * @since 4.4.9
+     */
+    public NHttpClientEventHandler getHandler() {
+        return handler;
     }
 
     @Override