01: package org.mockejb.jms;
02:
03: import javax.jms.*;
04: import org.mockejb.MethodNotImplementedException;
05:
06: /**
07: * <code>TopicConnection</code> implementation
08: * @author Dimitar Gospodinov
09: */
10: class TopicConnectionImpl extends MockConnection implements
11: TopicConnection {
12:
13: /**
14: * Creates new topic connection for the specified client Id.
15: * @param clientId
16: */
17: TopicConnectionImpl(int clientId) {
18: super ("TopicClient:" + clientId);
19: }
20:
21: /**
22: * Creates new topic session.
23: * @see javax.jms.TopicConnection#createTopicSession(boolean, int)
24: */
25: public TopicSession createTopicSession(boolean transacted,
26: int acknowledgeMode) throws JMSException {
27:
28: return (TopicSession) createSession(transacted, acknowledgeMode);
29: }
30:
31: /**
32: * Not implemented.
33: * @see javax.jms.TopicConnection#createConnectionConsumer(
34: * javax.jms.Topic, java.lang.String,
35: * javax.jms.ServerSessionPool,int)
36: */
37: public ConnectionConsumer createConnectionConsumer(Topic topic,
38: String messageSelector, ServerSessionPool sessionPool,
39: int maxMessages) throws JMSException {
40:
41: throw new MethodNotImplementedException(
42: "createConnectionConsumer", "TopicConnectionImpl");
43: }
44:
45: /**
46: * Not implemented.
47: */
48: public ConnectionConsumer createDurableConnectionConsumer(
49: Topic topic, String subscriptionName,
50: String messageSelector, ServerSessionPool sessionPool,
51: int maxMessages) throws JMSException {
52:
53: throw new javax.jms.IllegalStateException(
54: "Queue connection can not create durable connection consumer!");
55: }
56:
57: // Non-standard methods
58:
59: MockSession createMockSession(boolean transacted,
60: int acknowledgeMode) {
61: return new TopicSessionImpl(transacted, acknowledgeMode, this);
62: }
63: }
|