From d99f53fb5ef7970a63e150af0a22347c42767dd5 Mon Sep 17 00:00:00 2001 From: Rupert Smith Date: Mon, 21 May 2007 11:26:55 +0000 Subject: Merged revisions 540107 via svnmerge from https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r540107 | rupertlssmith | 2007-05-21 11:57:30 +0100 (Mon, 21 May 2007) | 1 line Documented all exception. ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@540119 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/server/cluster/AMQConnectionWaitException.java | 10 ++++++++++ .../server/cluster/AMQUnexpectedBodyTypeException.java | 15 ++++++++++++++- .../server/cluster/AMQUnexpectedFrameTypeException.java | 14 ++++++++++++++ .../apache/qpid/server/cluster/ClientHandlerRegistry.java | 4 ++-- .../apache/qpid/server/cluster/ServerHandlerRegistry.java | 4 ++-- 5 files changed, 42 insertions(+), 5 deletions(-) (limited to 'qpid/java/cluster/src/main') diff --git a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java index 4d2737edce..2baaa344ef 100644 --- a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java +++ b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java @@ -22,6 +22,16 @@ package org.apache.qpid.server.cluster; import org.apache.qpid.AMQException; +/** + * AMQConnectionWaitException represents a failure to connect to a cluster peer in a timely manner. + * + *

+ *
CRC Card
Responsibilities Collaborations + *
Represents failure to connect to a cluster peer in a timely manner. + *
+ * + * @todo Not an AMQP exception as no status code. + */ public class AMQConnectionWaitException extends AMQException { public AMQConnectionWaitException(String s, Throwable e) diff --git a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java index 22a94d3c75..951bd22df0 100644 --- a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java +++ b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java @@ -23,9 +23,22 @@ package org.apache.qpid.server.cluster; import org.apache.qpid.AMQException; import org.apache.qpid.framing.AMQBody; +/** + * AMQUnexpectedBodyTypeException represents a failure where a message body does not match its expected type. For example, + * and AMQP method should have a method body. + * + *

+ *
CRC Card
Responsibilities Collaborations + *
Represents a failure where a message body does not match its expected type. + *
+ * + * @todo Not an AMQP exception as no status code. + * + * @todo Seems like this exception was created to handle an unsafe type cast that will never happen in practice. Would + * be better just to leave that as a ClassCastException. Check that the framing layer will pick up the error first. + */ public class AMQUnexpectedBodyTypeException extends AMQException { - public AMQUnexpectedBodyTypeException(Class expectedClass, AMQBody body) { super("Unexpected body type. Expected: " + expectedClass.getName() + "; got: " + body.getClass().getName()); diff --git a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java index 721da24d53..4dd318f90d 100644 --- a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java +++ b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java @@ -22,6 +22,20 @@ package org.apache.qpid.server.cluster; import org.apache.qpid.AMQException; +/** + * AMQUnexpectedFrameTypeException represents a failure when Mina passes an unexpected frame type. + * + *

+ *
CRC Card
Responsibilities Collaborations + *
Represents failure to cast a frame to its expected type. + *
+ * + * @todo Not an AMQP exception as no status code. + * + * @todo Seems like this exception was created to handle an unsafe type cast that will never happen in practice. Would + * be better just to leave that as a ClassCastException. However, check the framing layer catches this error + * first. + */ public class AMQUnexpectedFrameTypeException extends AMQException { public AMQUnexpectedFrameTypeException(String s) diff --git a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java index 5300912716..c1caf8bbff 100644 --- a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java +++ b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java @@ -27,7 +27,7 @@ import org.apache.qpid.client.handler.ConnectionStartMethodHandler; import org.apache.qpid.client.handler.ConnectionTuneMethodHandler; import org.apache.qpid.client.state.AMQState; import org.apache.qpid.client.state.AMQStateManager; -import org.apache.qpid.client.state.IllegalStateTransitionException; +// import org.apache.qpid.client.state.IllegalStateTransitionException; import org.apache.qpid.client.state.StateAwareMethodListener; import org.apache.qpid.client.protocol.AMQProtocolSession; import org.apache.qpid.framing.*; @@ -78,7 +78,7 @@ public class ClientHandlerRegistry extends AMQStateManager return registry; } - protected StateAwareMethodListener findStateTransitionHandler(AMQState state, AMQMethodBody frame) throws IllegalStateTransitionException + protected StateAwareMethodListener findStateTransitionHandler(AMQState state, AMQMethodBody frame) //throws IllegalStateTransitionException { ClientRegistry registry = _handlers.get(state); return registry == null ? null : registry.getHandler(frame); diff --git a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java index 03b0dc7f2e..aadcfa4b4c 100644 --- a/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java +++ b/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java @@ -24,7 +24,7 @@ import org.apache.log4j.Logger; import org.apache.qpid.framing.AMQMethodBody; import org.apache.qpid.server.state.AMQState; import org.apache.qpid.server.state.AMQStateManager; -import org.apache.qpid.server.state.IllegalStateTransitionException; +//import org.apache.qpid.server.state.IllegalStateTransitionException; import org.apache.qpid.server.state.StateAwareMethodListener; import org.apache.qpid.server.cluster.util.LogMessage; import org.apache.qpid.server.queue.QueueRegistry; @@ -74,7 +74,7 @@ class ServerHandlerRegistry extends AMQStateManager } } - protected StateAwareMethodListener findStateTransitionHandler(AMQState state, B frame) throws IllegalStateTransitionException + protected StateAwareMethodListener findStateTransitionHandler(AMQState state, B frame) //throws IllegalStateTransitionException { MethodHandlerRegistry registry = _handlers.get(state); StateAwareMethodListener handler = (registry == null) ? null : registry.getHandler(frame); -- cgit v1.2.1