01: package com.mockrunner.mock.jms;
02:
03: import javax.jms.JMSException;
04: import javax.jms.ServerSession;
05: import javax.jms.ServerSessionPool;
06:
07: /**
08: * Mock implementation of JMS <code>ServerSessionPool</code>.
09: */
10: public class MockServerSessionPool implements ServerSessionPool {
11: private MockConnection connection;
12: private ServerSession session;
13:
14: public MockServerSessionPool(MockConnection connection) {
15: this .connection = connection;
16: session = new MockServerSession(connection);
17: }
18:
19: public void setServerSession(ServerSession session) {
20: this .session = session;
21: }
22:
23: public ServerSession getServerSession() throws JMSException {
24: connection.throwJMSException();
25: return session;
26: }
27: }
|