From ad806562f83ebca3bc9d246772b235eb9c696b82 Mon Sep 17 00:00:00 2001 From: Bhupendra Bhusman Bhardwaj Date: Thu, 14 Dec 2006 18:40:34 +0000 Subject: git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@487299 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/server/protocol/AMQMinaProtocolSession.java | 2 +- .../apache/qpid/server/protocol/AMQProtocolSessionMBean.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'java') diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java index 407ad236ea..c38f7f630b 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java +++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java @@ -305,7 +305,7 @@ public class AMQMinaProtocolSession implements AMQProtocolSession, return new ArrayList(_channelMap.values()); } - public AMQChannel getChannel(int channelId) + public AMQChannel getChannel(int channelId) throws AMQException { return _channelMap.get(channelId); } diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java index b56d22d655..a47d462810 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java +++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java @@ -187,13 +187,14 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed */ public void closeChannel(int id) throws JMException { - AMQChannel channel = _session.getChannel(id); - if (channel == null) - { - throw new JMException("The channel (channel Id = " + id + ") does not exist"); - } try { + AMQChannel channel = _session.getChannel(id); + if (channel == null) + { + throw new JMException("The channel (channel Id = " + id + ") does not exist"); + } + _session.closeChannel(id); } catch (AMQException ex) -- cgit v1.2.1