01: package org.mockejb.jms;
02:
03: import java.util.Enumeration;
04: import java.util.NoSuchElementException;
05:
06: import javax.jms.ConnectionMetaData;
07: import javax.jms.JMSException;
08:
09: /**
10: * Connection meta data for MockEjb JMS implementation.
11: *
12: * @author Dimitar Gospodinov
13: * @see javax.jms.ConnectionMetaData
14: */
15: class ConnectionMetaDataImpl implements ConnectionMetaData {
16:
17: /**
18: * @see javax.jms.ConnectionMetaData#getJMSVersion()
19: */
20: public String getJMSVersion() throws JMSException {
21: return getJMSMajorVersion() + "." + getJMSMinorVersion();
22: }
23:
24: /**
25: * @see javax.jms.ConnectionMetaData#getJMSMajorVersion()
26: */
27: public int getJMSMajorVersion() throws JMSException {
28: return 1;
29: }
30:
31: /**
32: * @see javax.jms.ConnectionMetaData#getJMSMinorVersion()
33: */
34: public int getJMSMinorVersion() throws JMSException {
35: return 1;
36: }
37:
38: /**
39: * @see javax.jms.ConnectionMetaData#getJMSProviderName()
40: */
41: public String getJMSProviderName() throws JMSException {
42: return "MockEjb";
43: }
44:
45: /**
46: * @see javax.jms.ConnectionMetaData#getProviderVersion()
47: */
48: public String getProviderVersion() throws JMSException {
49: return getProviderMajorVersion() + "."
50: + getProviderMinorVersion();
51: }
52:
53: /**
54: * @see javax.jms.ConnectionMetaData#getProviderMajorVersion()
55: */
56: public int getProviderMajorVersion() throws JMSException {
57: return 1;
58: }
59:
60: /**
61: * @see javax.jms.ConnectionMetaData#getProviderMinorVersion()
62: */
63: public int getProviderMinorVersion() throws JMSException {
64: return 0;
65: }
66:
67: /**
68: * Returns empty <code>Enumeration</code>
69: * @see javax.jms.ConnectionMetaData#getJMSXPropertyNames()
70: */
71: public Enumeration getJMSXPropertyNames() throws JMSException {
72: return new Enumeration() {
73: public boolean hasMoreElements() {
74: return false;
75: }
76:
77: public Object nextElement() {
78: throw new NoSuchElementException();
79: }
80: };
81: }
82:
83: }
|