1 46 package org.mr.api.jms; 47 52 import java.io.Serializable ; 53 import java.util.Enumeration ; 54 import java.util.Vector ; 55 56 import javax.jms.ConnectionMetaData ; 57 import javax.jms.JMSException ; 58 59 import org.mr.Version; 60 61 public class MantaConnectionMetaData implements Serializable , ConnectionMetaData { 62 63 64 67 private static final long serialVersionUID = 9213953066729918790L; 68 73 public MantaConnectionMetaData() { 74 jmsxProperties = new Vector (); 75 76 String version = Version.version ; 77 version = version.substring(version.indexOf(" ")); 78 String [] ver = version.split("\\."); 79 if(ver.length ==3){ 80 REVISION = Integer.parseInt(ver[0].trim()); 81 MAJOR_VERSION = Integer.parseInt(ver[1].trim()); 82 MINOR_VERSION = Integer.parseInt(ver[2].trim()); 83 }else if(ver.length ==2){ 84 REVISION = Integer.parseInt(ver[0].trim()); 85 MAJOR_VERSION = Integer.parseInt(ver[1].trim()); 86 MINOR_VERSION = 0; 87 }else{ 88 REVISION = Integer.parseInt(ver[0].trim()); 89 MAJOR_VERSION = 0; 90 MINOR_VERSION = 0; 91 } 92 93 } 94 95 103 public int getJMSMajorVersion() throws JMSException { 104 105 return JMS_MAJOR_VERSION; 107 108 } 112 113 121 public int getJMSMinorVersion() throws JMSException { 122 return JMS_MINOR_VERSION; 123 } 125 126 134 public String getJMSProviderName() throws JMSException { 135 return PROVIDER_NAME; 136 } 138 139 147 public String getJMSVersion() throws JMSException { 148 return JMS_VERSION; 149 } 151 159 public Enumeration getJMSXPropertyNames() throws JMSException { 160 161 return jmsxProperties.elements(); 162 } 163 164 165 173 public int getProviderMajorVersion() throws JMSException { 174 return MAJOR_VERSION; 175 } 177 185 public int getProviderMinorVersion() throws JMSException { 186 return MINOR_VERSION; 187 } 189 190 198 public String getProviderVersion() throws JMSException { 199 return Version.version; 200 } 202 203 public static int MINOR_VERSION = 1; 205 public static int MAJOR_VERSION = 4; 206 public static int REVISION = 1; 207 208 public static final String PROVIDER_NAME = "MantaRay"; 209 public static final int JMS_MAJOR_VERSION = 1; 210 public static final int JMS_MINOR_VERSION = 1; 211 public static final String JMS_VERSION = "1.1"; 212 Vector jmsxProperties; 213 } 214 | Popular Tags |