KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > jms > MockTopicConnection


1 package com.mockobjects.jms;
2
3 import com.mockobjects.*;
4
5 import javax.jms.*;
6
7 public class MockTopicConnection extends MockConnection implements TopicConnection {
8
9     private final ReturnValue topicSessionToReturn = new ReturnValue("topic session");
10
11     public void setupCreateTopicSession(TopicSession topicSessionToReturn) {
12         this.topicSessionToReturn.setValue(topicSessionToReturn);
13     }
14
15     public ConnectionConsumer createConnectionConsumer(Topic topic,
16         String JavaDoc messageSelector, ServerSessionPool sessionPool, int maxMessages)
17         throws JMSException {
18
19         notImplemented();
20         return null;
21     }
22
23     public ConnectionConsumer createDurableConnectionConsumer(Topic topic,
24         String JavaDoc subscriptionName, String JavaDoc messageSelector,
25         ServerSessionPool sessionPool, int maxMessages) throws JMSException {
26
27         notImplemented();
28         return null;
29     }
30
31     public TopicSession createTopicSession(boolean transacted,
32         int acknowledgeMode) throws JMSException {
33
34         return (TopicSession)topicSessionToReturn.getValue();
35     }
36 }
37
Popular Tags