From 4eb87d127edb3dc44512eb63318638f91a2f0f2d Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Tue, 23 Jan 2007 20:31:10 +0000 Subject: removed XXX from resend, centralized message deliver, cleaned up exception handling, added per channel max frame size git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@499121 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/client/protocol/AMQProtocolSession.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'java/client/src') diff --git a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java index 5ea2e66b35..2980a86374 100644 --- a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java +++ b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java @@ -46,6 +46,7 @@ import org.apache.qpid.framing.MessageAppendBody; import org.apache.qpid.framing.ProtocolInitiation; import org.apache.qpid.framing.ProtocolVersionList; import org.apache.qpid.framing.RequestManager; +import org.apache.qpid.framing.RequestResponseMappingException; import org.apache.qpid.framing.ResponseManager; import org.apache.qpid.protocol.AMQMethodEvent; import org.apache.qpid.protocol.AMQMethodListener; @@ -314,25 +315,26 @@ public class AMQProtocolSession implements AMQProtocolWriter, ProtocolVersionLis public long writeRequest(int channelNum, AMQMethodBody methodBody, AMQMethodListener methodListener) - throws AMQException { RequestManager requestManager = (RequestManager)_channelId2RequestMgrMap.get(channelNum); if (requestManager == null) - throw new AMQException("Unable to find RequestManager for channel " + channelNum); + throw new IllegalArgumentException("Unable to find RequestManager for channel " + channelNum); return requestManager.sendRequest(methodBody, methodListener); } public void writeResponse(int channelNum, long requestId, AMQMethodBody methodBody) - throws AMQException { ResponseManager responseManager = (ResponseManager)_channelId2ResponseMgrMap.get(channelNum); if (responseManager == null) - throw new AMQException("Unable to find ResponseManager for channel " + channelNum); - responseManager.sendResponse(requestId, methodBody); + throw new IllegalArgumentException("Unable to find ResponseManager for channel " + channelNum); + try { + responseManager.sendResponse(requestId, methodBody); + } catch (RequestResponseMappingException e) { + throw new RuntimeException(e); + } } public void writeResponse(AMQMethodEvent evt, AMQMethodBody response) - throws AMQException { writeResponse(evt.getChannelId(), evt.getRequestId(), response); } -- cgit v1.2.1