KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > client > jms > TopicConnection


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - ScalAgent Distributed Technologies
4  * Copyright (C) 1996 - Dyade
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA.
20  *
21  * Initial developer(s): Frederic Maistre (INRIA)
22  * Contributor(s): ScalAgent Distributed Technologies
23  */

24 package org.objectweb.joram.client.jms;
25
26 import javax.jms.JMSException JavaDoc;
27 import javax.jms.IllegalStateException JavaDoc;
28
29 import org.objectweb.joram.client.jms.connection.RequestChannel;
30
31 /**
32  * Implements the <code>javax.jms.TopicConnection</code> interface.
33  */

34 public class TopicConnection extends Connection
35     implements javax.jms.TopicConnection JavaDoc {
36
37   /**
38    * Creates a <code>TopicConnection</code> instance.
39    *
40    * @param factoryParameters The factory parameters.
41    * @param connectionImpl The actual connection to wrap.
42    *
43    * @exception JMSSecurityException If the user identification is incorrect.
44    * @exception IllegalStateException If the server is not listening.
45    */

46   public TopicConnection(FactoryParameters factoryParameters,
47                          RequestChannel requestChannel)
48     throws JMSException JavaDoc {
49     super(factoryParameters, requestChannel);
50   }
51
52   /**
53    * API method.
54    *
55    * @exception IllegalStateException If the connection is closed.
56    * @exception InvalidSelectorException If the selector syntax is wrong.
57    * @exception InvalidDestinationException If the target destination does
58    * not exist.
59    * @exception JMSException If the method fails for any other reason.
60    */

61   public javax.jms.ConnectionConsumer JavaDoc
62          createConnectionConsumer(javax.jms.Topic JavaDoc topic, String JavaDoc selector,
63                                   javax.jms.ServerSessionPool JavaDoc sessionPool,
64                                   int maxMessages)
65     throws JMSException JavaDoc {
66     return super.createConnectionConsumer(
67       topic,
68       selector,
69       sessionPool,
70       maxMessages);
71   }
72
73   /**
74    * API method.
75    *
76    * @exception IllegalStateException If the connection is closed.
77    * @exception InvalidSelectorException If the selector syntax is wrong.
78    * @exception InvalidDestinationException If the target topic does
79    * not exist.
80    * @exception JMSException If the method fails for any other reason.
81    */

82   public javax.jms.ConnectionConsumer JavaDoc
83          createDurableConnectionConsumer(javax.jms.Topic JavaDoc topic, String JavaDoc subName,
84                                          String JavaDoc selector,
85                                          javax.jms.ServerSessionPool JavaDoc sessPool,
86                                          int maxMessages) throws JMSException JavaDoc
87   {
88     return super.createDurableConnectionConsumer(
89       topic,
90       subName,
91       selector,
92       sessPool,
93       maxMessages);
94   }
95
96   /**
97    * API method.
98    *
99    * @exception IllegalStateException If the connection is closed.
100    * @exception JMSException In case of an invalid acknowledge mode.
101    */

102   public javax.jms.TopicSession JavaDoc
103          createTopicSession(boolean transacted, int acknowledgeMode)
104          throws JMSException JavaDoc
105   {
106     checkClosed();
107     TopicSession ts = new TopicSession(
108       this,
109       transacted,
110       acknowledgeMode,
111       getRequestMultiplexer());
112     addSession(ts);
113     return ts;
114   }
115 }
116
Popular Tags