From 332aae366c0da4e5c0adfeca2e9c5184b291cd99 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Wed, 21 Mar 2007 12:51:09 +0000 Subject: [PATCH] fixes for LargeStreamletTest git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@520865 13f79535-47bb-0310-9956-ffa450edef68 --- .../broker/region/QueueSubscription.java | 2 +- .../apache/activemq/command/ActiveMQMessage.java | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java index 8875f83c02..051ef19cb6 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java @@ -131,7 +131,7 @@ public class QueueSubscription extends PrefetchSubscription implements LockOwner if (message instanceof ActiveMQMessage) { ActiveMQMessage activeMessage = (ActiveMQMessage) message; try { - activeMessage.setBooleanProperty("JMSXGroupFirstForConsumer", true); + activeMessage.setBooleanProperty("JMSXGroupFirstForConsumer", true, false); } catch (JMSException e) { log.warn("Failed to set boolean header: " + e, e); diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java index a767c75ac0..4c7c6aaf63 100755 --- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java +++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java @@ -381,9 +381,16 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess } }); } + + public void setObjectProperty(String name, Object value) throws JMSException{ + setObjectProperty(name,value,true); + } - public void setObjectProperty(String name, Object value) throws JMSException { - checkReadOnlyProperties(); + public void setObjectProperty(String name, Object value, boolean checkReadOnly) throws JMSException { + + if (checkReadOnly) { + checkReadOnlyProperties(); + } if (name == null || name.equals("")) { throw new IllegalArgumentException("Property name cannot be empty or null"); } @@ -535,7 +542,10 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess } public void setBooleanProperty(String name, boolean value) throws JMSException { - setObjectProperty(name, value ? Boolean.TRUE : Boolean.FALSE); + setBooleanProperty(name,value,true); + } + public void setBooleanProperty(String name, boolean value,boolean checkReadOnly) throws JMSException { + setObjectProperty(name, value ? Boolean.TRUE : Boolean.FALSE,checkReadOnly); } public void setByteProperty(String name, byte value) throws JMSException {