KickJava   Java API By Example, From Geeks To Geeks.

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


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 javax.jms.JMSException JavaDoc;
32 import javax.jms.Queue JavaDoc;
33 import javax.jms.QueueReceiver JavaDoc;
34 import javax.jms.QueueSender JavaDoc;
35 import javax.jms.QueueSession JavaDoc;
36
37 /**
38  * A sample queue session. Lets the client create queues, browsers, etc.
39  */

40 public class QueueSessionImpl extends SessionImpl implements QueueSession JavaDoc {
41   /**
42    * Creates the session
43    */

44   public QueueSessionImpl(ConnectionImpl connection,
45               boolean isTransacted, int ackMode)
46     throws JMSException JavaDoc
47   {
48     super(connection, isTransacted, ackMode);
49   }
50
51   /**
52    * Creates a receiver to receive messages.
53    *
54    * @param queue the queue to receive messages from.
55    */

56   public QueueReceiver JavaDoc createReceiver(Queue JavaDoc queue)
57     throws JMSException JavaDoc
58   {
59     checkOpen();
60     
61     return createReceiver(queue, null);
62   }
63
64   /**
65    * Creates a receiver to receive messages.
66    *
67    * @param queue the queue to receive messages from.
68    * @param messageSelector query to restrict the messages.
69    */

70   public QueueReceiver JavaDoc createReceiver(Queue JavaDoc queue, String JavaDoc messageSelector)
71     throws JMSException JavaDoc
72   {
73     return (QueueReceiver JavaDoc) createConsumer(queue, messageSelector);
74   }
75
76   /**
77    * Creates a QueueSender to send messages to a queue.
78    *
79    * @param queue the queue to send messages to.
80    */

81   public QueueSender JavaDoc createSender(Queue JavaDoc queue)
82     throws JMSException JavaDoc
83   {
84     checkOpen();
85     
86     return (QueueSender JavaDoc) createProducer(queue);
87   }
88 }
89
Popular Tags