KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > client > JBossConnectionMetaData


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.jms.client;
8
9 import java.util.Enumeration JavaDoc;
10
11 import javax.jms.ConnectionMetaData JavaDoc;
12 import javax.jms.JMSException JavaDoc;
13
14 /**
15  * Connection metadata
16  *
17  * @author <a HREF="mailto:adrian@jboss.org>Adrian Brock</a>
18  * @version $Revision: 1.1 $
19  */

20 public class JBossConnectionMetaData
21    implements ConnectionMetaData JavaDoc
22 {
23    // Constants -----------------------------------------------------
24

25    // Attributes ----------------------------------------------------
26

27    /** The connection for this meta data */
28    private ConnectionDelegate connection;
29
30    // Static --------------------------------------------------------
31

32    // Constructors --------------------------------------------------
33

34    /**
35     * Create a new metadata object
36     *
37     * @param connection the connection for this meta data
38     */

39    public JBossConnectionMetaData(ConnectionDelegate connection)
40       throws JMSException JavaDoc
41    {
42       this.connection = connection;
43    }
44
45     // Public --------------------------------------------------------
46

47    /**
48     * Get the connection for this meta data
49     *
50     * @return the connection
51     * @throws JMSException for any error
52     */

53    public ConnectionDelegate getConnection() throws JMSException JavaDoc
54    {
55       return connection;
56    }
57
58    // ConnectionMetaData implementation -----------------------------
59

60     public int getJMSMajorVersion() throws JMSException JavaDoc
61     {
62         return 1;
63     }
64
65     public int getJMSMinorVersion() throws JMSException JavaDoc
66     {
67         return 1;
68     }
69
70     public String JavaDoc getJMSProviderName() throws JMSException JavaDoc
71     {
72       return "JBoss.org";
73     }
74
75     public String JavaDoc getJMSVersion() throws JMSException JavaDoc
76     {
77       return getJMSMajorVersion() + "." + getJMSMinorVersion();
78     }
79
80     public Enumeration JavaDoc getJMSXPropertyNames() throws JMSException JavaDoc
81     {
82        return connection.getJMSXPropertyNames();
83     }
84
85     public int getProviderMajorVersion() throws JMSException JavaDoc
86     {
87       return 4;
88     }
89
90     public int getProviderMinorVersion() throws JMSException JavaDoc
91     {
92         return 0;
93     }
94
95     public String JavaDoc getProviderVersion() throws JMSException JavaDoc
96     {
97       return getProviderMajorVersion() + "." + getProviderMinorVersion();
98     }
99
100    // Protected ------------------------------------------------------
101

102    // Package Private ------------------------------------------------
103

104    // Private --------------------------------------------------------
105

106    // Inner Classes --------------------------------------------------
107
}
108
Popular Tags