summaryrefslogtreecommitdiff
path: root/java/client
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-02-20 09:16:59 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-02-20 09:16:59 +0000
commitc5211e63139dcd0ddfb2061b8ada312e6ea3083c (patch)
tree53b336e3ed265db410689baf02c591a0d1017e25 /java/client
parent625170d9a3f64970987161c59a60497065c4bef6 (diff)
downloadqpid-python-c5211e63139dcd0ddfb2061b8ada312e6ea3083c.tar.gz
Renamed AMQInvalidSelectorException to be AMQInvalidArgumentException to better fit the generic use of the argument table in the AMQP Queue.Bind spec. Adjusted AMQConstant to match the proposal for additional codes AMQP-39,40,41 (https://wiki.108.redhat.com/jira/browse/AMQP-39).
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@509478 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client')
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQSession.java10
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java7
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java8
3 files changed, 13 insertions, 12 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
index 6d4d6cbaad..b08a97bc84 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
@@ -56,9 +56,9 @@ import javax.jms.TopicSubscriber;
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidSelectorException;
import org.apache.qpid.AMQUndeliveredException;
import org.apache.qpid.AMQInvalidRoutingKeyException;
+import org.apache.qpid.AMQInvalidArgumentException;
import org.apache.qpid.client.failover.FailoverSupport;
import org.apache.qpid.client.message.AbstractJMSMessage;
import org.apache.qpid.client.message.JMSBytesMessage;
@@ -521,7 +521,7 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
0, // methodId
AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
new AMQShortString("JMS client closing channel")); // replyText
-
+
getProtocolHandler().syncWrite(frame, ChannelCloseOkBody.class, timeout);
// When control resumes at this point, a reply will have been received that
// indicates the broker has closed the channel successfully
@@ -1049,7 +1049,7 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
{
registerConsumer(consumer, false);
}
- catch (AMQInvalidSelectorException ise)
+ catch (AMQInvalidArgumentException ise)
{
JMSException ex = new InvalidSelectorException(ise.getMessage());
ex.setLinkedException(ise);
@@ -1057,7 +1057,9 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
}
catch (AMQInvalidRoutingKeyException e)
{
- throw new InvalidDestinationException(amqd.getRoutingKey().toString());
+ JMSException ide = new InvalidDestinationException("Invalid routing key:"+amqd.getRoutingKey().toString());
+ ide.setLinkedException(e);
+ throw ide;
}
catch (AMQException e)
{
diff --git a/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java b/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
index 6ef187286b..7cadbd409a 100644
--- a/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
+++ b/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
@@ -23,7 +23,6 @@ package org.apache.qpid.client.handler;
import org.apache.log4j.Logger;
import org.apache.qpid.AMQChannelClosedException;
import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidSelectorException;
import org.apache.qpid.AMQInvalidRoutingKeyException;
import org.apache.qpid.client.AMQNoConsumersException;
import org.apache.qpid.client.AMQNoRouteException;
@@ -74,11 +73,11 @@ public class ChannelCloseMethodHandler implements StateAwareMethodListener
{
throw new AMQNoRouteException("Error: " + reason, null);
}
- else if (errorCode == AMQConstant.INVALID_SELECTOR)
+ else if (errorCode == AMQConstant.INVALID_ARGUMENT)
{
- _logger.debug("Broker responded with Invalid Selector.");
+ _logger.debug("Broker responded with Invalid Argument.");
- throw new AMQInvalidSelectorException(String.valueOf(reason));
+ throw new org.apache.qpid.AMQInvalidArgumentException(String.valueOf(reason));
}
else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
{
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java
index e70196dff2..5e45d1d537 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java
@@ -29,9 +29,9 @@ import org.apache.qpid.client.AMQNoRouteException;
import org.apache.qpid.protocol.AMQMethodEvent;
import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidSelectorException;
import org.apache.qpid.AMQInvalidRoutingKeyException;
import org.apache.qpid.AMQChannelClosedException;
+import org.apache.qpid.AMQInvalidArgumentException;
import org.apache.qpid.framing.ChannelCloseBody;
import org.apache.qpid.framing.AMQShortString;
@@ -73,11 +73,11 @@ public class ChannelCloseMethodHandlerNoCloseOk implements StateAwareMethodListe
{
throw new AMQNoRouteException("Error: " + reason, null);
}
- else if (errorCode == AMQConstant.INVALID_SELECTOR)
+ else if (errorCode == AMQConstant.INVALID_ARGUMENT)
{
- _logger.debug("Broker responded with Invalid Selector.");
+ _logger.debug("Broker responded with Invalid Argument.");
- throw new AMQInvalidSelectorException(String.valueOf(reason));
+ throw new AMQInvalidArgumentException(String.valueOf(reason));
}
else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
{