KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > presumo > jms > client > JmsTopicConnection


1 /**
2  * This file is part of Presumo.
3  *
4  * Presumo is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Presumo is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Presumo; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  *
19  * Copyright 2001 Dan Greff
20  */

21 package com.presumo.jms.client;
22
23 import com.presumo.util.log.Logger;
24 import com.presumo.util.log.LoggerFactory;
25 import com.presumo.jms.resources.Resources;
26 import com.presumo.jms.router.Router;
27
28 import javax.jms.ConnectionConsumer JavaDoc;
29 import javax.jms.JMSException JavaDoc;
30 import javax.jms.TopicConnection JavaDoc;
31 import javax.jms.TopicSession JavaDoc;
32 import javax.jms.ServerSessionPool JavaDoc;
33 import javax.jms.Session JavaDoc;
34 import javax.jms.Topic JavaDoc;
35
36  /**
37   * @see javax.jms.TopicConnection
38   * @author Dan Greff
39   */

40 public class JmsTopicConnection
41   extends JmsConnection implements TopicConnection JavaDoc
42 {
43
44     /////////////////////////////////////////////////////////////////////////
45
// Constructors //
46
/////////////////////////////////////////////////////////////////////////
47

48   public JmsTopicConnection(Router router)
49   {
50     super(router);
51   }
52   
53   public JmsTopicConnection(Router router, String JavaDoc host, int port)
54       throws JMSException JavaDoc
55   {
56     super(router, host, port);
57   }
58
59     ///////////////////////////////////////////////////////////////////////////
60
// Public Methods //
61
///////////////////////////////////////////////////////////////////////////
62

63   public synchronized TopicSession JavaDoc
64   createTopicSession(boolean transacted, int acknowledgeMode)
65     throws JMSException JavaDoc
66   {
67     logger.entry("createTopicSession");
68
69     // note: Currently JmsSession's constructor adds the session
70
// to the router.
71
JmsTopicSession retval =
72       new JmsTopicSession(router, transacted, acknowledgeMode, this);
73       
74     sessions.add(retval);
75       
76     if (started)
77       retval.start();
78     
79     logger.exit("createTopicSession");
80     return retval;
81   }
82
83
84   /**
85    * Currently not implemented.
86    */

87   public ConnectionConsumer JavaDoc createConnectionConsumer(Topic JavaDoc topic,
88                                                      String JavaDoc messageSelector,
89                                                      ServerSessionPool JavaDoc sessionPool,
90                                                      int maxMessages)
91     throws JMSException JavaDoc
92   {
93     throw new IllegalStateException JavaDoc("Operation not permited");
94   }
95
96   /**
97    * Currently not implemented.
98    */

99   public ConnectionConsumer JavaDoc createDurableConnectionConsumer(Topic JavaDoc topic,
100                                                             String JavaDoc subscriptionName,
101                                                             String JavaDoc messageSelector,
102                                                             ServerSessionPool JavaDoc sessionPool,
103                                                             int maxMessages)
104     throws JMSException JavaDoc
105   {
106     throw new IllegalStateException JavaDoc("Operation not permitted.");
107   }
108
109
110   ////////////////////////////// Misc stuff ////////////////////////////////
111
private static Logger logger =
112     LoggerFactory.getLogger(JmsTopicConnection.class, Resources.getBundle());
113   ///////////////////////////////////////////////////////////////////////////
114

115 }
116
117
118
119
Popular Tags