hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [1/2] httpcomponents-core git commit: [HTTPCORE-470] Add a org.apache.http.nio.protocol.NullRequestHandler singleton
Date Wed, 24 May 2017 07:13:34 GMT
Repository: httpcomponents-core
Updated Branches:
  refs/heads/dev/4.4.x/HTTPCORE-470 d292645fc -> e87f59632


[HTTPCORE-470] Add a org.apache.http.nio.protocol.NullRequestHandler singleton


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

Branch: refs/heads/dev/4.4.x/HTTPCORE-470
Commit: d3901eb9a0928f023a147fdd4cf801881e219d4d
Parents: 4bbd024
Author: Gary Gregory <ggregory@apache.org>
Authored: Wed May 24 00:12:29 2017 -0700
Committer: Gary Gregory <ggregory@apache.org>
Committed: Wed May 24 00:12:29 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/http/nio/protocol/HttpAsyncService.java     | 2 +-
 .../java/org/apache/http/nio/protocol/NullRequestHandler.java   | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d3901eb9/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
index 789b304..cc8dc37 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
@@ -761,7 +761,7 @@ public class HttpAsyncService implements NHttpServerEventHandler {
             handler = (HttpAsyncRequestHandler<Object>) this.handlerMapper.lookup(request);
         }
         if (handler == null) {
-            handler = new NullRequestHandler();
+            handler = NullRequestHandler.INSTANCE;
         }
         return handler;
     }

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d3901eb9/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
index 8d465e0..7dad232 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
@@ -36,6 +36,11 @@ import org.apache.http.protocol.HttpContext;
 
 class NullRequestHandler implements HttpAsyncRequestHandler<Object> {
 
+    /**
+     * @since 4.4.7
+     */
+    public static final NullRequestHandler INSTANCE = new NullRequestHandler();
+
     public NullRequestHandler() {
         super();
     }


Mime
View raw message