From 8161438b7cba2a24d0a6549bd06a85f87b6441ac Mon Sep 17 00:00:00 2001 From: Kenneth Anthony Giusti Date: Wed, 22 Jun 2011 15:22:00 +0000 Subject: QPID-3079: resync to trunk git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3079@1138503 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/swig_ruby_typemaps.i | 2 +- .../org/apache/qpid/client/CustomJMSXProperty.java | 29 +++++++++++----------- .../apache/qpid/client/QpidConnectionMetaData.java | 9 ++++--- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/qpid/cpp/bindings/swig_ruby_typemaps.i b/qpid/cpp/bindings/swig_ruby_typemaps.i index 79e679663d..326d607c8d 100644 --- a/qpid/cpp/bindings/swig_ruby_typemaps.i +++ b/qpid/cpp/bindings/swig_ruby_typemaps.i @@ -49,7 +49,7 @@ } VALUE VariantToRb(const qpid::types::Variant* v) { - VALUE result; + VALUE result = Qnil; try { switch (v->getType()) { case qpid::types::VAR_VOID: { diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java b/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java index 7cc548915c..e81e754da2 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java @@ -23,6 +23,7 @@ package org.apache.qpid.client; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; +import java.util.List; import org.apache.qpid.framing.AMQShortString; @@ -34,6 +35,18 @@ public enum CustomJMSXProperty JMSXGroupSeq, JMSXUserID; + private static List _names; + + static + { + CustomJMSXProperty[] properties = values(); + _names = new ArrayList(properties.length); + for(CustomJMSXProperty property : properties) + { + _names.add(property.toString()); + } + + } private final AMQShortString _nameAsShortString; @@ -47,20 +60,8 @@ public enum CustomJMSXProperty return _nameAsShortString; } - private static Enumeration _names; - - public static synchronized Enumeration asEnumeration() + public static Enumeration asEnumeration() { - if(_names == null) - { - CustomJMSXProperty[] properties = values(); - ArrayList nameList = new ArrayList(properties.length); - for(CustomJMSXProperty property : properties) - { - nameList.add(property.toString()); - } - _names = Collections.enumeration(nameList); - } - return _names; + return Collections.enumeration(_names); } } diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java b/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java index 3bb5707417..5cf767ac35 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java @@ -30,9 +30,11 @@ import org.apache.qpid.common.QpidProperties; public class QpidConnectionMetaData implements ConnectionMetaData { + private AMQConnection con; QpidConnectionMetaData(AMQConnection conn) { + this.con = conn; } public int getJMSMajorVersion() throws JMSException @@ -62,12 +64,12 @@ public class QpidConnectionMetaData implements ConnectionMetaData public int getProviderMajorVersion() throws JMSException { - return 0; + return con.getProtocolVersion().getMajorVersion(); } public int getProviderMinorVersion() throws JMSException { - return 8; + return con.getProtocolVersion().getMinorVersion(); } public String getProviderVersion() throws JMSException @@ -78,8 +80,7 @@ public class QpidConnectionMetaData implements ConnectionMetaData private String getProtocolVersion() { - // TODO - Implement based on connection negotiated protocol - return "0.8"; + return con.getProtocolVersion().toString(); } public String getBrokerVersion() -- cgit v1.2.1