KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > jms > session > QueueConnectionImpl


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.jms.session;
30
31 import com.caucho.jms.ConnectionFactoryImpl;
32
33 import javax.jms.ConnectionConsumer JavaDoc;
34 import javax.jms.JMSException JavaDoc;
35 import javax.jms.Queue JavaDoc;
36 import javax.jms.QueueConnection JavaDoc;
37 import javax.jms.QueueSession JavaDoc;
38 import javax.jms.ServerSessionPool JavaDoc;
39
40 /**
41  * A sample queue connection factory.
42  */

43 public class QueueConnectionImpl extends ConnectionImpl
44   implements QueueConnection JavaDoc {
45   /**
46    * Create a new queue connection.
47    */

48   public QueueConnectionImpl(ConnectionFactoryImpl factory)
49   {
50     super(factory);
51   }
52
53   /**
54    * Creates a new consumer (optional)
55    */

56   public ConnectionConsumer JavaDoc
57   createConnectionConsumer(Queue JavaDoc queue, String JavaDoc messageSelector,
58                            ServerSessionPool JavaDoc sessionPool, int maxMessages)
59     throws JMSException JavaDoc
60   {
61     throw new UnsupportedOperationException JavaDoc();
62   }
63
64   /**
65    * Creates a new connection session.
66    */

67   public QueueSession JavaDoc createQueueSession(boolean transacted,
68                                          int acknowledgeMode)
69     throws JMSException JavaDoc
70   {
71     checkOpen();
72
73     assignClientID();
74     
75     return new QueueSessionImpl(this, transacted, acknowledgeMode);
76   }
77 }
78
Popular Tags