01: package com.mockrunner.mock.jms;
02:
03: import javax.jms.JMSException;
04: import javax.jms.MessageProducer;
05: import javax.jms.Session;
06: import javax.jms.Topic;
07: import javax.jms.TopicPublisher;
08: import javax.jms.TopicSession;
09: import javax.jms.TopicSubscriber;
10:
11: /**
12: * Mock implementation of JMS <code>TopicSession</code>.
13: */
14: public class MockTopicSession extends MockSession implements
15: TopicSession {
16: public MockTopicSession(MockTopicConnection connection) {
17: this (connection, false, Session.AUTO_ACKNOWLEDGE);
18: }
19:
20: public MockTopicSession(MockTopicConnection connection,
21: boolean transacted, int acknowledgeMode) {
22: super (connection, transacted, acknowledgeMode);
23: }
24:
25: public TopicPublisher createPublisher(Topic topic)
26: throws JMSException {
27: return (TopicPublisher) createProducer(topic);
28: }
29:
30: public TopicSubscriber createSubscriber(Topic topic)
31: throws JMSException {
32: return (TopicSubscriber) createConsumer(topic);
33: }
34:
35: public TopicSubscriber createSubscriber(Topic topic,
36: String messageSelector, boolean noLocal)
37: throws JMSException {
38: return (TopicSubscriber) createConsumer(topic, messageSelector,
39: noLocal);
40: }
41:
42: protected MessageProducer createProducerForNullDestination() {
43: return getGenericTransmissionManager().createTopicPublisher();
44: }
45: }
|