From e3ff96a57778ea2325551dff110e4bedf7e1d4d5 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Mon, 19 Feb 2007 11:55:47 +0000 Subject: QPID-372, QPID-376 Broker now ignores all frames for closing channels. When a close-ok is received the channel can be reopened and used All uses of getChannel check the return type is not null and throw a NOT_FOUND AMQException. If the channel is not found during a method handler then the Channel will be closed. ChannelCloseHandler - Now throws a connection exception if trying to close a a non exisitant channel. AMQMinaProtocolSession - Added pre-check for closing channels to ignore all but Close-OK methods - Updated ChannelException method to close connection if the CE was a result of not having a valid channel. - Changed state to CLOSING when writing out a connection close frame. AMQConnection - Wrapped all _logging calls , Updated comment formatting AMQSession - called startDispatcherIfRequired when receiving a message as without it a producer will not get a returned message. This is because there is no consumer setup to consume. ConnectionCloseMethodHandler - Wrapped code in try finally so that the protocol session would always be closed correctly. AMQStateManager - Added state to the logging values Modified AMQTimeoutException to include a new constant value to identify the failure reason. AMQConstant - Added 408 REQUEST_TIMEOUT fixed error with NOT_ALLOWED value was 530 should be 507. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@509172 13f79535-47bb-0310-9956-ffa450edef68 --- java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java | 4 +++- java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'java/common') diff --git a/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java b/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java index 6af681f479..f1f973542d 100644 --- a/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java +++ b/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java @@ -20,10 +20,12 @@ */ package org.apache.qpid; +import org.apache.qpid.protocol.AMQConstant; + public class AMQTimeoutException extends AMQException { public AMQTimeoutException(String message) { - super(message); + super(AMQConstant.REQUEST_TIMEOUT, message); } } diff --git a/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java b/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java index 05365de137..0c4736a348 100644 --- a/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java +++ b/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java @@ -90,6 +90,8 @@ public final class AMQConstant public static final AMQConstant IN_USE = new AMQConstant(406, "In use", true); + public static final AMQConstant REQUEST_TIMEOUT = new AMQConstant(408, "Request Timeout", true); + public static final AMQConstant FRAME_ERROR = new AMQConstant(501, "frame error", true); public static final AMQConstant SYNTAX_ERROR = new AMQConstant(502, "syntax error", true); @@ -100,7 +102,7 @@ public final class AMQConstant public static final AMQConstant RESOURCE_ERROR = new AMQConstant(506, "resource error", true); - public static final AMQConstant NOT_ALLOWED = new AMQConstant(530, "not allowed", true); + public static final AMQConstant NOT_ALLOWED = new AMQConstant(507, "not allowed", true); public static final AMQConstant NOT_IMPLEMENTED = new AMQConstant(540, "not implemented", true); -- cgit v1.2.1