From 0778dc8875fa039dba274db7ff546e394ade0d52 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Thu, 22 May 2014 15:00:08 +0000 Subject: QPID-5771: ensure the closed event is passed to the listener even if closing the endpoint input throws something, ensure the connection is unregistered from the connection registry git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1596894 13f79535-47bb-0310-9956-ffa450edef68 --- .../server/protocol/v1_0/ProtocolEngine_1_0_0_SASL.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0_SASL.java b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0_SASL.java index ef85e019e6..0d6861d80c 100644 --- a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0_SASL.java +++ b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0_SASL.java @@ -34,7 +34,6 @@ import javax.security.sasl.SaslException; import javax.security.sasl.SaslServer; import org.apache.log4j.Logger; - import org.apache.qpid.amqp_1_0.codec.FrameWriter; import org.apache.qpid.amqp_1_0.codec.ProtocolHandler; import org.apache.qpid.amqp_1_0.framing.AMQFrame; @@ -433,10 +432,16 @@ public class ProtocolEngine_1_0_0_SASL implements ServerProtocolEngine, FrameOut try { // todo - _endpoint.inputClosed(); - if (_endpoint != null && _endpoint.getConnectionEventListener() != null) + try { - ((Connection_1_0) _endpoint.getConnectionEventListener()).closed(); + _endpoint.inputClosed(); + } + finally + { + if (_endpoint != null && _endpoint.getConnectionEventListener() != null) + { + ((Connection_1_0) _endpoint.getConnectionEventListener()).closed(); + } } } catch(RuntimeException e) -- cgit v1.2.1