diff options
author | Robert Gemmell <robbie@apache.org> | 2009-04-10 20:00:52 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2009-04-10 20:00:52 +0000 |
commit | 93e76957d3658bbac2428a36911ad6ae5ff6abcb (patch) | |
tree | bc62c88b04395edbc74f0da64f15a1fa0ee3b105 /java/broker | |
parent | f9ebbf2933e48e35303f10c3a92d2e2852980870 (diff) | |
download | qpid-python-93e76957d3658bbac2428a36911ad6ae5ff6abcb.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
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@764026 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker')
4 files changed, 8 insertions, 6 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java index 2ff54fb748..b46d6b6f12 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java @@ -443,7 +443,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/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java b/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java index a22eea2b5e..e98a40fc6c 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java @@ -116,7 +116,8 @@ public class FileQueueBackingStore implements QueueBackingStore mmd.setArrivalTime(arrivaltime); AMQMessage message; - if (((BasicContentHeaderProperties) chb.properties).getDeliveryMode() == 2) + if (((BasicContentHeaderProperties) chb.properties).getDeliveryMode() == + BasicContentHeaderProperties.PERSISTENT) { message = new PersistentAMQMessage(messageId, null); } diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java b/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java index bab19fbc54..36ca197fa6 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java @@ -265,9 +265,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/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java b/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java index 9b91c71a1d..b09283b11f 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java +++ b/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; } } |