qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject qpid-jms git commit: QPIDJMS-146: add the listener to the future when creating the handler during initial channel config, avoiding need to look the handler up later to add it
Date Wed, 06 Jan 2016 13:13:05 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master b32a56b2e -> ebe8163ee


QPIDJMS-146: add the listener to the future when creating the handler during initial channel
config, avoiding need to look the handler up later to add it


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/ebe8163e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/ebe8163e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/ebe8163e

Branch: refs/heads/master
Commit: ebe8163ee51cc83bbfdd7ee5ac798c9234dcdf25
Parents: b32a56b
Author: Robert Gemmell <robbie@apache.org>
Authored: Wed Jan 6 13:08:28 2016 +0000
Committer: Robert Gemmell <robbie@apache.org>
Committed: Wed Jan 6 13:08:28 2016 +0000

----------------------------------------------------------------------
 .../jms/transports/netty/NettySslTransport.java | 24 +++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/ebe8163e/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettySslTransport.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettySslTransport.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettySslTransport.java
index 0d83826..89a7579 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettySslTransport.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettySslTransport.java
@@ -67,17 +67,9 @@ public class NettySslTransport extends NettyTcpTransport implements SSLTransport
     }
 
     @Override
-    protected void configureChannel(Channel channel) throws Exception {
-        channel.pipeline().addLast(TransportSupport.createSslHandler(getRemoteLocation(),
getSslOptions()));
-        super.configureChannel(channel);
-    }
-
-    @Override
-    protected void handleConnected(final Channel channel) throws Exception {
-        SslHandler sslHandler = channel.pipeline().get(SslHandler.class);
-
-        Future<Channel> channelFuture = sslHandler.handshakeFuture();
-        channelFuture.addListener(new GenericFutureListener<Future<Channel>>()
{
+    protected void configureChannel(final Channel channel) throws Exception {
+        SslHandler sslHandler = TransportSupport.createSslHandler(getRemoteLocation(), getSslOptions());
+        sslHandler.handshakeFuture().addListener(new GenericFutureListener<Future<Channel>>()
{
             @Override
             public void operationComplete(Future<Channel> future) throws Exception
{
                 if (future.isSuccess()) {
@@ -89,6 +81,16 @@ public class NettySslTransport extends NettyTcpTransport implements SSLTransport
                 }
             }
         });
+
+        channel.pipeline().addLast(sslHandler);
+
+        super.configureChannel(channel);
+    }
+
+    @Override
+    protected void handleConnected(final Channel channel) throws Exception {
+        // In this transport, the next step is taken by the handshake future
+        // completion listener added when configuring the channel above
     }
 
     @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message