01: package org.mockejb.jms;
02:
03: import javax.jms.*;
04: import org.mockejb.MethodNotImplementedException;
05:
06: /**
07: * <code>QueueConnection</code> implementation.
08: * @author Dimitar Gospodinov
09: * @see javax.jms.QueueConnection
10: */
11: class QueueConnectionImpl extends MockConnection implements
12: QueueConnection {
13:
14: /**
15: * Creates new queue connection for the specified client Id.
16: * @param clientId
17: */
18: QueueConnectionImpl(int clientId) {
19: super ("QueueClient:" + clientId);
20: }
21:
22: /**
23: * Creates queue session.
24: */
25: public QueueSession createQueueSession(boolean transacted,
26: int acknowledgeMode) throws JMSException {
27:
28: return (QueueSession) createSession(transacted, acknowledgeMode);
29: }
30:
31: /**
32: * Not implemented.
33: */
34: public ConnectionConsumer createConnectionConsumer(Queue queue,
35: String messageSelector, ServerSessionPool sessionPool,
36: int maxMessages) throws JMSException {
37:
38: checkClosed();
39:
40: throw new MethodNotImplementedException(
41: "createConnectionConsumer", "QueueConnectionImpl");
42: }
43:
44: // Non-standard methods
45:
46: MockSession createMockSession(boolean transacted,
47: int acknowledgeMode) {
48: return new QueueSessionImpl(transacted, acknowledgeMode, this);
49: }
50:
51: }
|