hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1781648 - in /httpcomponents/httpcore/trunk: httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/ httpcore5-testing/src/main/java/org/apache/hc/core5/testing/n...
Date Sat, 04 Feb 2017 09:32:40 GMT
Author: olegk
Date: Sat Feb  4 09:32:40 2017
New Revision: 1781648

URL: http://svn.apache.org/viewvc?rev=1781648&view=rev
Log:
Pass session request attachment to IOEventHandlerFactory#createHandler

Modified:
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiatorFactory.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiatorFactory.java
    httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalClientHttp1EventHandlerFactory.java
    httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalServerHttp1EventHandlerFactory.java
    httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalClientHttp2EventHandlerFactory.java
    httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalServerHttp2EventHandlerFactory.java
    httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TestDefaultListeningIOReactor.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1IOEventHandlerFactory.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOEventHandlerFactory.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorImpl.java

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiatorFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiatorFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiatorFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiatorFactory.java
Sat Feb  4 09:32:40 2017
@@ -83,7 +83,7 @@ public class ClientHttpProtocolNegotiato
     }
 
     @Override
-    public ClientHttpProtocolNegotiator createHandler(final IOSession ioSession) {
+    public ClientHttpProtocolNegotiator createHandler(final IOSession ioSession, final Object
attachment) {
         return new ClientHttpProtocolNegotiator(ioSession, httpProcessor, pushHandlerFactory,
                 charCodingConfig, h2Config, connectionListener, streamListener);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiatorFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiatorFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiatorFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiatorFactory.java
Sat Feb  4 09:32:40 2017
@@ -82,7 +82,7 @@ public class ServerHttpProtocolNegotiato
     }
 
     @Override
-    public ServerHttpProtocolNegotiator createHandler(final IOSession ioSession) {
+    public ServerHttpProtocolNegotiator createHandler(final IOSession ioSession, final Object
attachment) {
         if (tlsStrategy != null && ioSession instanceof TransportSecurityLayer) {
             tlsStrategy.upgrade(
                     (TransportSecurityLayer) ioSession,

Modified: httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalClientHttp1EventHandlerFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalClientHttp1EventHandlerFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalClientHttp1EventHandlerFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalClientHttp1EventHandlerFactory.java
Sat Feb  4 09:32:40 2017
@@ -119,7 +119,7 @@ class InternalClientHttp1EventHandlerFac
     }
 
     @Override
-    public IOEventHandler createHandler(final IOSession ioSession) {
+    public IOEventHandler createHandler(final IOSession ioSession, final Object attachment)
{
         final String id = "http1-outgoing-" + COUNT.incrementAndGet();
         if (sslContext != null && ioSession instanceof TransportSecurityLayer) {
             ((TransportSecurityLayer) ioSession).start(sslContext, null ,null, null);

Modified: httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalServerHttp1EventHandlerFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalServerHttp1EventHandlerFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalServerHttp1EventHandlerFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http/InternalServerHttp1EventHandlerFactory.java
Sat Feb  4 09:32:40 2017
@@ -124,7 +124,7 @@ class InternalServerHttp1EventHandlerFac
     }
 
     @Override
-    public IOEventHandler createHandler(final IOSession ioSession) {
+    public IOEventHandler createHandler(final IOSession ioSession, final Object attachment)
{
         final String id = "http1-incoming-" + COUNT.incrementAndGet();
         if (sslContext != null && ioSession instanceof TransportSecurityLayer) {
             ((TransportSecurityLayer) ioSession).start(sslContext, null ,null, null);

Modified: httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalClientHttp2EventHandlerFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalClientHttp2EventHandlerFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalClientHttp2EventHandlerFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalClientHttp2EventHandlerFactory.java
Sat Feb  4 09:32:40 2017
@@ -75,7 +75,7 @@ class InternalClientHttp2EventHandlerFac
     }
 
     @Override
-    public IOEventHandler createHandler(final IOSession ioSession) {
+    public IOEventHandler createHandler(final IOSession ioSession, final Object attachment)
{
         final String id = "http2-outgoing-" + COUNT.incrementAndGet();
         if (sslContext != null && ioSession instanceof TransportSecurityLayer) {
             ((TransportSecurityLayer) ioSession).start(sslContext, null ,null, null);

Modified: httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalServerHttp2EventHandlerFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalServerHttp2EventHandlerFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalServerHttp2EventHandlerFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/http2/InternalServerHttp2EventHandlerFactory.java
Sat Feb  4 09:32:40 2017
@@ -75,7 +75,7 @@ class InternalServerHttp2EventHandlerFac
     }
 
     @Override
-    public IOEventHandler createHandler(final IOSession ioSession) {
+    public IOEventHandler createHandler(final IOSession ioSession, final Object attachment)
{
         final String id = "http2-incoming-" + COUNT.incrementAndGet();
         if (sslContext != null && ioSession instanceof TransportSecurityLayer) {
             ((TransportSecurityLayer) ioSession).start(sslContext, null ,null, null);

Modified: httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TestDefaultListeningIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TestDefaultListeningIOReactor.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TestDefaultListeningIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TestDefaultListeningIOReactor.java
Sat Feb  4 09:32:40 2017
@@ -62,7 +62,7 @@ public class TestDefaultListeningIOReact
         this.ioreactor = new DefaultListeningIOReactor(new IOEventHandlerFactory() {
 
             @Override
-            public IOEventHandler createHandler(final IOSession ioSession) {
+            public IOEventHandler createHandler(final IOSession ioSession, final Object attachment)
{
                 return new IOEventHandler() {
 
                     @Override

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1IOEventHandlerFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1IOEventHandlerFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1IOEventHandlerFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1IOEventHandlerFactory.java
Sat Feb  4 09:32:40 2017
@@ -116,7 +116,7 @@ public class ClientHttp1IOEventHandlerFa
     }
 
     @Override
-    public IOEventHandler createHandler(final IOSession ioSession) {
+    public IOEventHandler createHandler(final IOSession ioSession, final Object attachment)
{
         return new ClientHttp1IOEventHandler(createStreamDuplexer(ioSession));
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java
Sat Feb  4 09:32:40 2017
@@ -136,7 +136,7 @@ public class ServerHttp1IOEventHandlerFa
     }
 
     @Override
-    public IOEventHandler createHandler(final IOSession ioSession) {
+    public IOEventHandler createHandler(final IOSession ioSession, final Object attachment)
{
         return new ServerHttp1IOEventHandler(createStreamDuplexer(ioSession));
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOEventHandlerFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOEventHandlerFactory.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOEventHandlerFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOEventHandlerFactory.java
Sat Feb  4 09:32:40 2017
@@ -34,6 +34,6 @@ package org.apache.hc.core5.reactor;
  */
 public interface IOEventHandlerFactory {
 
-    IOEventHandler createHandler(IOSession ioSession);
+    IOEventHandler createHandler(IOSession ioSession, Object attachment);
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorImpl.java?rev=1781648&r1=1781647&r2=1781648&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorImpl.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorImpl.java
Sat Feb  4 09:32:40 2017
@@ -269,7 +269,8 @@ class IOReactorImpl implements IOReactor
                         sessionRequest != null ?  sessionRequest.getRemoteEndpoint() : null,
                         new IOSessionImpl(key, socketChannel),
                         closedSessions);
-                session.setHandler(this.eventHandlerFactory.createHandler(session));
+                session.setHandler(this.eventHandlerFactory.createHandler(session,
+                        sessionRequest != null ? sessionRequest.getAttachment() : null));
                 session.setSocketTimeout(this.reactorConfig.getSoTimeout());
                 key.attach(session);
             } catch (final ClosedChannelException ex) {



Mime
View raw message