01: package com.mockrunner.mock.jms;
02:
03: import javax.jms.JMSException;
04: import javax.jms.MessageProducer;
05: import javax.jms.Queue;
06: import javax.jms.QueueReceiver;
07: import javax.jms.QueueSender;
08: import javax.jms.QueueSession;
09: import javax.jms.Session;
10:
11: /**
12: * Mock implementation of JMS <code>QueueSession</code>.
13: */
14: public class MockQueueSession extends MockSession implements
15: QueueSession {
16: public MockQueueSession(MockQueueConnection connection) {
17: this (connection, false, Session.AUTO_ACKNOWLEDGE);
18: }
19:
20: public MockQueueSession(MockQueueConnection connection,
21: boolean transacted, int acknowledgeMode) {
22: super (connection, transacted, acknowledgeMode);
23: }
24:
25: public QueueReceiver createReceiver(Queue queue)
26: throws JMSException {
27: return (QueueReceiver) createConsumer(queue);
28: }
29:
30: public QueueReceiver createReceiver(Queue queue,
31: String messageSelector) throws JMSException {
32: return (QueueReceiver) createConsumer(queue, messageSelector);
33: }
34:
35: public QueueSender createSender(Queue queue) throws JMSException {
36: return (QueueSender) createProducer(queue);
37: }
38:
39: protected MessageProducer createProducerForNullDestination() {
40: return getGenericTransmissionManager().createQueueSender();
41: }
42: }
|