KickJava   Java API By Example, From Geeks To Geeks.

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


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.QueueConnection</code> interface.
33  */

34 public class QueueConnection extends Connection
35     implements javax.jms.QueueConnection JavaDoc {
36
37   /**
38    * Creates a <code>QueueConnection</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 QueueConnection(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.Queue JavaDoc queue,
63                                String JavaDoc selector,
64                                javax.jms.ServerSessionPool JavaDoc sessionPool,
65                                int maxMessages)
66     throws JMSException JavaDoc {
67     return super.createConnectionConsumer(
68       queue,
69       selector,
70       sessionPool,
71       maxMessages);
72   }
73
74   /**
75    * API method.
76    *
77    * @exception IllegalStateException If the connection is closed.
78    * @exception JMSException In case of an invalid acknowledge mode.
79    */

80   public synchronized javax.jms.QueueSession JavaDoc
81          createQueueSession(boolean transacted, int acknowledgeMode)
82          throws JMSException JavaDoc
83   {
84     checkClosed();
85     QueueSession qs = new QueueSession(
86       this,
87       transacted,
88       acknowledgeMode,
89       getRequestMultiplexer());
90     addSession(qs);
91     return qs;
92   }
93
94   /**
95    * API method.
96    *
97    * @exception IllegalStateException Systematically.
98    */

99   public javax.jms.ConnectionConsumer JavaDoc
100          createDurableConnectionConsumer(javax.jms.Topic JavaDoc topic, String JavaDoc name,
101                                          String JavaDoc selector,
102                                          javax.jms.ServerSessionPool JavaDoc sessPool,
103                                          int maxMessages) throws JMSException JavaDoc
104   {
105     throw new IllegalStateException JavaDoc("Forbidden call on a QueueConnection.");
106   }
107 }
108
Popular Tags