diff options
author | Robert Gemmell <robbie@apache.org> | 2009-04-17 15:20:15 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2009-04-17 15:20:15 +0000 |
commit | 995f9588cdac264428d319910f22c4202a7aca1a (patch) | |
tree | bedc8b460e9b8681a38647aa76c9d670bcc6a5d5 | |
parent | c20fd6ef380754d9907c31e430c89f3596d1f104 (diff) | |
download | qpid-python-995f9588cdac264428d319910f22c4202a7aca1a.tar.gz |
QPID-1798: Update AMQQueueMBean to use new constant value of DeliveryMode, replacing previously incorrect literal value used in conditional statement and thus preventing the reversal of delivery mode status. Also update other broker classes making similar comparisons using a literal value to use a constant.
merged from trunk r764026, as changes were lost during /broker 0.5-fix process. Excludes changes to sections no longer present, and changes still present in /common from previous commit.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@766047 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 6 insertions, 5 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java index c8ead67b1f..a6beb6cbf5 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java @@ -428,7 +428,8 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue, Que list.add("JMSCorrelationID = " + headerProperties.getCorrelationIdAsString()); int delMode = headerProperties.getDeliveryMode(); - list.add("JMSDeliveryMode = " + ((delMode == 1) ? "Persistent" : "Non_Persistent")); + list.add("JMSDeliveryMode = " + + ((delMode == BasicContentHeaderProperties.PERSISTENT) ? "Persistent" : "Non_Persistent")); list.add("JMSPriority = " + headerProperties.getPriority()); list.add("JMSType = " + headerProperties.getType()); diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java index 091baf2751..d5e0b4d187 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java @@ -282,9 +282,9 @@ public class IncomingMessage implements Filterable<RuntimeException> public boolean isPersistent() { - //todo remove literal values to a constant file such as AMQConstants in common return getContentHeaderBody().properties instanceof BasicContentHeaderProperties && - ((BasicContentHeaderProperties) getContentHeaderBody().properties).getDeliveryMode() == 2; + ((BasicContentHeaderProperties) getContentHeaderBody().properties).getDeliveryMode() == + BasicContentHeaderProperties.PERSISTENT; } public boolean isRedelivered() diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java index 9b91c71a1d..b09283b11f 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java @@ -120,8 +120,8 @@ public class TransientMessageData public boolean isPersistent() { - //todo remove literal values to a constant file such as AMQConstants in common return _contentHeaderBody.properties instanceof BasicContentHeaderProperties && - ((BasicContentHeaderProperties) _contentHeaderBody.properties).getDeliveryMode() == 2; + ((BasicContentHeaderProperties) _contentHeaderBody.properties).getDeliveryMode() == + BasicContentHeaderProperties.PERSISTENT; } } |