summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2009-04-17 15:20:15 +0000
committerRobert Gemmell <robbie@apache.org>2009-04-17 15:20:15 +0000
commita7c950bb9b5d6c92da8c2a5cc0b19dd727f3d71f (patch)
tree24709a8ca4de940a6e1cc25fbac2220877f29192
parentc08491ec735227b512c085cd7fd08639e9ae0268 (diff)
downloadqpid-python-a7c950bb9b5d6c92da8c2a5cc0b19dd727f3d71f.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/qpid@766047 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java3
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java4
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java4
3 files changed, 6 insertions, 5 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 c8ead67b1f..a6beb6cbf5 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
@@ -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/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 091baf2751..d5e0b4d187 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
@@ -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/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;
}
}