diff options
| author | Rupert Smith <rupertlssmith@apache.org> | 2007-05-21 11:26:55 +0000 |
|---|---|---|
| committer | Rupert Smith <rupertlssmith@apache.org> | 2007-05-21 11:26:55 +0000 |
| commit | 21d2df094acb8530b2fb902b5ed9a1d7db8463fd (patch) | |
| tree | 2db927674c4edc9809348b078d38705fa24ee965 /java/cluster | |
| parent | 225e38f7c110fca5b7e6f3738dfdad8de96cd50e (diff) | |
| download | qpid-python-21d2df094acb8530b2fb902b5ed9a1d7db8463fd.tar.gz | |
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/qpid@540119 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/cluster')
5 files changed, 42 insertions, 5 deletions
diff --git a/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java b/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java index 4d2737edce..2baaa344ef 100644 --- a/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java +++ b/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.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to connect to a cluster peer in a timely manner.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ */
public class AMQConnectionWaitException extends AMQException
{
public AMQConnectionWaitException(String s, Throwable e)
diff --git a/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java b/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java index 22a94d3c75..951bd22df0 100644 --- a/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java +++ b/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.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents a failure where a message body does not match its expected type.
+ * </table>
+ *
+ * @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<? extends AMQBody> expectedClass, AMQBody body)
{
super("Unexpected body type. Expected: " + expectedClass.getName() + "; got: " + body.getClass().getName());
diff --git a/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java b/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java index 721da24d53..4dd318f90d 100644 --- a/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java +++ b/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.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to cast a frame to its expected type.
+ * </table>
+ *
+ * @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/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java b/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java index 5300912716..c1caf8bbff 100644 --- a/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java +++ b/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/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java b/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java index 03b0dc7f2e..aadcfa4b4c 100644 --- a/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java +++ b/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 <B extends AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState state, B frame) throws IllegalStateTransitionException + protected <B extends AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState state, B frame) //throws IllegalStateTransitionException { MethodHandlerRegistry registry = _handlers.get(state); StateAwareMethodListener<B> handler = (registry == null) ? null : registry.getHandler(frame); |
