You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2013/09/26 11:23:40 UTC
svn commit: r1526425 -
/qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java
Author: rgodfrey
Date: Thu Sep 26 09:23:39 2013
New Revision: 1526425
URL: http://svn.apache.org/r1526425
Log:
QPID-5615 : No mapping from JMS JMSXGroupID property to AMQP message group-id
Modified:
qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java
Modified: qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java?rev=1526425&r1=1526424&r2=1526425&view=diff
==============================================================================
--- qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java (original)
+++ qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java Thu Sep 26 09:23:39 2013
@@ -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 implem
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 implem
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 implem
names.add((String)key);
}
}
+ if(_properties.getGroupId() != null)
+ {
+ names.add(JMSXGROUP_ID);
+ }
return Collections.enumeration(names);
}
@@ -883,79 +892,91 @@ public abstract class MessageImpl implem
}
}
- 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()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org