/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq;

import java.util.Enumeration;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.jms.ConnectionMetaData;

/**
 * A <CODE>ConnectionMetaData</CODE> object provides information describing
 * the <CODE>Connection</CODE> object.
 */

public final class ActiveMQConnectionMetaData implements ConnectionMetaData {

    public static final String PROVIDER_VERSION;
    public static final int PROVIDER_MAJOR_VERSION;
    public static final int PROVIDER_MINOR_VERSION;

    public static final ActiveMQConnectionMetaData INSTANCE = new ActiveMQConnectionMetaData();

    static {
        String version = null;
        int major = 0;
        int minor = 0;
        try {
            Package p = Package.getPackage("org.apache.activemq");
            if (p != null) {
                version = p.getImplementationVersion();
                Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+).*");
                Matcher m = pattern.matcher(version);
                if (m.matches()) {
                    major = Integer.parseInt(m.group(1));
                    minor = Integer.parseInt(m.group(2));
                }
            }
        } catch (Throwable e) {
        }
        PROVIDER_VERSION = version;
        PROVIDER_MAJOR_VERSION = major;
        PROVIDER_MINOR_VERSION = minor;
    }

    private ActiveMQConnectionMetaData() {
    }

    /**
     * Gets the JMS API version.
     * 
     * @return the JMS API version
     */

    public String getJMSVersion() {
        return "1.1";
    }

    /**
     * Gets the JMS major version number.
     * 
     * @return the JMS API major version number
     */

    public int getJMSMajorVersion() {
        return 1;
    }

    /**
     * Gets the JMS minor version number.
     * 
     * @return the JMS API minor version number
     */

    public int getJMSMinorVersion() {
        return 1;
    }

    /**
     * Gets the JMS provider name.
     * 
     * @return the JMS provider name
     */

    public String getJMSProviderName() {
        return "ActiveMQ";
    }

    /**
     * Gets the JMS provider version.
     * 
     * @return the JMS provider version
     */

    public String getProviderVersion() {
        return PROVIDER_VERSION;
    }

    /**
     * Gets the JMS provider major version number.
     * 
     * @return the JMS provider major version number
     */

    public int getProviderMajorVersion() {
        return PROVIDER_MAJOR_VERSION;
    }

    /**
     * Gets the JMS provider minor version number.
     * 
     * @return the JMS provider minor version number
     */

    public int getProviderMinorVersion() {
        return PROVIDER_MINOR_VERSION;
    }

    /**
     * Gets an enumeration of the JMSX property names.
     * 
     * @return an Enumeration of JMSX property names
     */

    public Enumeration<String> getJMSXPropertyNames() {
        Vector<String> jmxProperties = new Vector<String>();
        jmxProperties.add("JMSXGroupID");
        jmxProperties.add("JMSXGroupSeq");
        jmxProperties.add("JMSXDeliveryCount");
        jmxProperties.add("JMSXProducerTXID");
        return jmxProperties.elements();
    }
}

@@ -1108,17 +1108,16 @@
 ct.%0A */%0A
-%0A
 public f
@@ -2257,33 +2257,32 @@
  version.%0A     *
- 
 %0A     * @return 
@@ -2301,33 +2301,46 @@
 version%0A     */%0A
+    @Override
 %0A
-
     public Strin
@@ -2436,33 +2436,32 @@
 n number.%0A     *
- 
 %0A     * @return 
@@ -2493,33 +2493,46 @@
  number%0A     */%0A
+    @Override
 %0A
-
     public int g
@@ -2626,33 +2626,32 @@
 n number.%0A     *
- 
 %0A     * @return 
@@ -2683,33 +2683,46 @@
  number%0A     */%0A
+    @Override
 %0A
-
     public int g
@@ -2809,33 +2809,32 @@
 der name.%0A     *
- 
 %0A     * @return 
@@ -2855,33 +2855,46 @@
 er name%0A     */%0A
+    @Override
 %0A
-
     public Strin
@@ -2996,33 +2996,32 @@
  version.%0A     *
- 
 %0A     * @return 
@@ -3045,33 +3045,46 @@
 version%0A     */%0A
+    @Override
 %0A
-
     public Strin
@@ -3205,33 +3205,32 @@
 n number.%0A     *
- 
 %0A     * @return 
@@ -3267,33 +3267,46 @@
  number%0A     */%0A
+    @Override
 %0A
-
     public int g
@@ -3435,33 +3435,32 @@
 n number.%0A     *
- 
 %0A     * @return 
@@ -3497,33 +3497,46 @@
  number%0A     */%0A
+    @Override
 %0A
-
     public int g
@@ -3677,17 +3677,16 @@
 .%0A     *
- 
 %0A     * 
@@ -3739,17 +3739,30 @@
      */%0A
+    @Override
 %0A
-
     publ
@@ -3805,24 +3805,24 @@
 tyNames() %7B%0A
-
         Vect
@@ -3866,24 +3866,65 @@
 %3CString%3E();%0A
+        jmxProperties.add(%22JMSXUserID%22);%0A
         jmxP

fix for: https://issues.apache.org/jira/browse/AMQ-4202