1 /*** 2 * 3 * Copyright 2004 Protique Ltd 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 **/ 18 package org.codehaus.activemq; 19 20 import javax.jms.ConnectionMetaData; 21 import javax.jms.JMSException; 22 import java.util.Enumeration; 23 import java.util.Hashtable; 24 25 /*** 26 * A <CODE>ConnectionMetaData</CODE> object provides information describing 27 * the <CODE>Connection</CODE> object. 28 */ 29 30 public class ActiveMQConnectionMetaData implements ConnectionMetaData { 31 32 /*** 33 * Gets the JMS API version. 34 * 35 * @return the JMS API version 36 */ 37 38 public String getJMSVersion() { 39 return "1.1"; 40 } 41 42 /*** 43 * Gets the JMS major version number. 44 * 45 * @return the JMS API major version number 46 * @throws JMSException if the JMS provider fails to retrieve the metadata due to 47 * some internal error. 48 */ 49 50 public int getJMSMajorVersion() { 51 return 1; 52 } 53 54 /*** 55 * Gets the JMS minor version number. 56 * 57 * @return the JMS API minor version number 58 */ 59 60 public int getJMSMinorVersion() { 61 return 1; 62 } 63 64 /*** 65 * Gets the JMS provider name. 66 * 67 * @return the JMS provider name 68 */ 69 70 public String getJMSProviderName() { 71 return "Protique"; 72 } 73 74 /*** 75 * Gets the JMS provider version. 76 * 77 * @return the JMS provider version 78 */ 79 80 public String getProviderVersion() { 81 return "0.1"; 82 } 83 84 /*** 85 * Gets the JMS provider major version number. 86 * 87 * @return the JMS provider major version number 88 */ 89 90 public int getProviderMajorVersion() { 91 return 0; 92 } 93 94 /*** 95 * Gets the JMS provider minor version number. 96 * 97 * @return the JMS provider minor version number 98 */ 99 100 public int getProviderMinorVersion() { 101 return 1; 102 } 103 104 /*** 105 * Gets an enumeration of the JMSX property names. 106 * 107 * @return an Enumeration of JMSX property names 108 */ 109 110 public Enumeration getJMSXPropertyNames() { 111 Hashtable jmxProperties = new Hashtable(); 112 jmxProperties.put("JMSXGroupID", "1"); 113 jmxProperties.put("JMSXGroupSeq", "1"); 114 115 return jmxProperties.keys(); 116 } 117 }