diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2013-09-26 09:23:39 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2013-09-26 09:23:39 +0000 |
| commit | 624734f4cd4eb584dfafd55f4de8933e155f224d (patch) | |
| tree | 6423ff80ff370407a40051d83abd14a81e032e87 | |
| parent | 9c43528ad2c73edaea692288081aa39ae476d18f (diff) | |
| download | qpid-python-624734f4cd4eb584dfafd55f4de8933e155f224d.tar.gz | |
QPID-5615 : No mapping from JMS JMSXGroupID property to AMQP message group-id
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1526425 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java | 83 |
1 files changed, 52 insertions, 31 deletions
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java index 6d4fa9604f..fed9b5904f 100644 --- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java +++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java @@ -42,7 +42,6 @@ import javax.jms.JMSException; import javax.jms.MessageFormatException; import javax.jms.MessageNotReadableException; import javax.jms.MessageNotWriteableException; -import java.nio.charset.Charset; import java.util.*; public abstract class MessageImpl implements Message @@ -63,6 +62,8 @@ public abstract class MessageImpl implements Message static final Set<String> JMS_TEMP_QUEUE_ATTRIBUTES = set(QUEUE_ATTRIBUTE, TEMPORARY_ATTRIBUTE); static final Set<String> JMS_TEMP_TOPIC_ATTRIBUTES = set(TOPIC_ATTRIBUTE, TEMPORARY_ATTRIBUTE); + private static final String JMSXGROUP_ID = "JMSXGroupID"; + private Header _header; private Properties _properties; private ApplicationProperties _applicationProperties; @@ -456,6 +457,10 @@ public abstract class MessageImpl implements Message private Object getProperty(final Object name) { + if(JMSXGROUP_ID.equals(name)) + { + return _properties.getGroupId(); + } return _applicationProperties.getValue().get(name); } @@ -722,6 +727,10 @@ public abstract class MessageImpl implements Message names.add((String)key); } } + if(_properties.getGroupId() != null) + { + names.add(JMSXGROUP_ID); + } return Collections.enumeration(names); } @@ -883,79 +892,91 @@ public abstract class MessageImpl implements Message } } - public void setBooleanProperty(Object name, boolean b) throws JMSException + public void setBooleanProperty(Object name, boolean b) { - _applicationProperties.getValue().put(name, b); + setProperty(name, b); } - public void setByteProperty(Object name, byte b) throws JMSException + public void setByteProperty(Object name, byte b) { - _applicationProperties.getValue().put(name, b); + setProperty(name, b); } - public void setShortProperty(Object name, short i) throws JMSException + public void setShortProperty(Object name, short i) { - _applicationProperties.getValue().put(name, i); + setProperty(name, i); } - public void setIntProperty(Object name, int i) throws JMSException + public void setIntProperty(Object name, int i) { - _applicationProperties.getValue().put(name, i); + setProperty(name, i); } - public void setLongProperty(Object name, long l) throws JMSException + public void setLongProperty(Object name, long l) { - _applicationProperties.getValue().put(name, l); + setProperty(name, l); } - public void setFloatProperty(Object name, float v) throws JMSException + public void setFloatProperty(Object name, float v) { - _applicationProperties.getValue().put(name, v); + setProperty(name, v); } - public void setDoubleProperty(Object name, double v) throws JMSException + public void setDoubleProperty(Object name, double v) { - _applicationProperties.getValue().put(name, v); + setProperty(name, v); } - public void setStringProperty(Object name, String value) throws JMSException + public void setStringProperty(Object name, String value) { - _applicationProperties.getValue().put(name, value); + setProperty(name, value); } - public void setObjectProperty(Object name, Object value) throws JMSException + public void setObjectProperty(Object name, Object value) { - _applicationProperties.getValue().put(name, value); + setProperty(name, value); + } + + private void setProperty(Object name, Object value) + { + if(JMSXGROUP_ID.equals(name)) + { + _properties.setGroupId(value == null ? null : value.toString()); + } + else + { + _applicationProperties.getValue().put(name, value); + } } - public void setListProperty(final Object name, final List<Object> list) throws JMSException + public void setListProperty(final Object name, final List<Object> list) { - _applicationProperties.getValue().put(name, list); + setProperty(name, list); } - public void setMapProperty(final Object name, final Map<Object, Object> map) throws JMSException + public void setMapProperty(final Object name, final Map<Object, Object> map) { - _applicationProperties.getValue().put(name, map); + setProperty(name, map); } - public void setUnsignedByteProperty(final Object name, final UnsignedByte b) throws JMSException + public void setUnsignedByteProperty(final Object name, final UnsignedByte b) { - _applicationProperties.getValue().put(name, b); + setProperty(name, b); } - public void setUnsignedShortProperty(final Object name, final UnsignedShort s) throws JMSException + public void setUnsignedShortProperty(final Object name, final UnsignedShort s) { - _applicationProperties.getValue().put(name, s); + setProperty(name, s); } - public void setUnsignedIntProperty(final Object name, final UnsignedInteger i) throws JMSException + public void setUnsignedIntProperty(final Object name, final UnsignedInteger i) { - _applicationProperties.getValue().put(name, i); + setProperty(name, i); } - public void setUnsignedLongProperty(final Object name, final UnsignedLong l) throws JMSException + public void setUnsignedLongProperty(final Object name, final UnsignedLong l) { - _applicationProperties.getValue().put(name, l); + setProperty(name, l); } public UnsignedInteger getDeliveryFailures() |
