KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > client > jms > ConnectionMetaData


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - 2005 ScalAgent Distributed Technologies
4  * Copyright (C) 1996 - 2000 Dyade
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA.
20  *
21  * Initial developer(s): Frederic Maistre (INRIA)
22  * Contributor(s): ScalAgent Distributed Technologies
23  */

24 package org.objectweb.joram.client.jms;
25
26 import java.util.*;
27
28 import javax.jms.JMSException JavaDoc;
29
30
31 /**
32  * Implements the <code>javax.jms.ConnectionMetaData</code> interface.
33  */

34 public class ConnectionMetaData implements javax.jms.ConnectionMetaData JavaDoc {
35   /** JMS major version number */
36   public final static int jmsMajorVersion = 1;
37   /** JMS minor version number */
38   public final static int jmsMinorVersion = 1;
39   /** JMS provider name: Joram */
40   public final static String JavaDoc jmsProviderName = "Joram";
41   /** JMS API version, currently 1.1 */
42   public final static String JavaDoc jmsVersion = "1.1";
43   /** Joram's major version number */
44   public static int providerMajorVersion = 4;
45   /** Joram's minor version number */
46   public static int providerMinorVersion = 3;
47   /** Joram's implementation version, currently @version@. */
48   public final static String JavaDoc providerVersion = "@version@";
49   /** Enumeration of the Joram's JMSX property names */
50   public final static Vector jmsxProperties = new Vector();
51
52   static {
53     int idx1 = 0;
54     int idx2 = 0;
55     try {
56       idx1 = providerVersion.indexOf('.');
57       if (idx1 != -1) {
58         providerMajorVersion =
59           Integer.parseInt(providerVersion.substring(0, idx1));
60       }
61     } catch (Exception JavaDoc exc) {
62     }
63     try {
64       idx2 = providerVersion.indexOf('.', idx1 +1);
65       if (idx2 != -1) {
66         providerMinorVersion =
67           Integer.parseInt(providerVersion.substring(idx1 +1, idx2));
68       }
69     } catch (Exception JavaDoc exc) {
70     }
71
72     jmsxProperties.add("JMSXDeliveryCount");
73     jmsxProperties.add("JMSXGroupID");
74     jmsxProperties.add("JMSXGroupSeq");
75   }
76
77   /**
78    * API method: Gets the JMS major version number..
79    *
80    * @exception JMSException Actually never thrown.
81    */

82   public int getJMSMajorVersion() throws JMSException JavaDoc {
83     return jmsMajorVersion;
84   }
85
86   /**
87    * API method: Gets the JMS minor version number..
88    *
89    * @exception JMSException Actually never thrown.
90    */

91   public int getJMSMinorVersion() throws JMSException JavaDoc {
92     return jmsMinorVersion;
93   }
94
95   /**
96    * API method: Gets the JMS provider name: Joram.
97    *
98    * @exception JMSException Actually never thrown.
99    */

100   public String JavaDoc getJMSProviderName() throws JMSException JavaDoc {
101     return jmsProviderName;
102   }
103
104   /**
105    * API method: Gets the JMS API version, currently 1.1.
106    *
107    * @exception JMSException Actually never thrown.
108    */

109   public String JavaDoc getJMSVersion() throws JMSException JavaDoc {
110     return jmsVersion;
111   }
112
113   /**
114    * API method: Gets an enumeration of the JMSX property names.
115    *
116    * @exception JMSException Actually never thrown.
117    */

118   public Enumeration getJMSXPropertyNames() throws JMSException JavaDoc {
119     return jmsxProperties.elements();
120   }
121
122   /**
123    * API method: Gets the Joram's major version number.
124    *
125    * @exception JMSException Actually never thrown.
126    */

127   public int getProviderMajorVersion() throws JMSException JavaDoc {
128     return providerMajorVersion;
129   }
130
131   /**
132    * API method: Gets the Joram's minor version number.
133    *
134    * @exception JMSException Actually never thrown.
135    */

136   public int getProviderMinorVersion() throws JMSException JavaDoc {
137     return providerMinorVersion;
138   }
139
140   /**
141    * API method: Gets the Joram's implementation version, currently @version@.
142    *
143    * @exception JMSException Actually never thrown.
144    */

145   public String JavaDoc getProviderVersion() throws JMSException JavaDoc {
146     return providerVersion;
147   }
148 }
149
150
151
Popular Tags