KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > walend > somnifugi > SomniQueueReceiver


1 package net.walend.somnifugi;
2
3 import javax.jms.QueueReceiver JavaDoc;
4 import javax.jms.Queue JavaDoc;
5 import javax.jms.JMSException JavaDoc;
6
7 /**
8 A receiver end for a Queue. Get this from the Session.
9
10 @author <a HREF="http://walend.net">David Walend</a> <a HREF="mailto:david@walend.net">david@walend.net</a>
11 @author @pwang@ added support for client acknowledgement.
12  */

13
14 public class SomniQueueReceiver
15     extends SomniMessageConsumer
16     implements QueueReceiver JavaDoc
17 {
18     private SomniQueue queue;
19     private String JavaDoc name;
20
21     protected SomniQueueReceiver(SomniQueue queue,String JavaDoc name,SomniExceptionListener exceptionListener,SomniSession session)
22     {
23         super(queue.getTakable(),exceptionListener,session);
24         this.name = name;
25         this.queue = queue;
26     }
27
28     protected SomniQueueReceiver(SomniQueue queue,String JavaDoc name,SomniExceptionListener exceptionListener,SomniMessageSelector messageSelector,SomniSession session)
29         throws SomniMessageSelectorException
30     {
31         super(queue.getTakable(messageSelector),exceptionListener,messageSelector,session);
32         this.name = name;
33         this.queue = queue;
34     }
35
36     /** Gets the <CODE>Queue</CODE> associated with this queue receiver.
37  
38 @return this receiver's <CODE>Queue</CODE>
39  
40 @exception JMSException if the JMS provider fails to get the queue for
41                         this queue receiver
42                         due to some internal error.
43       */

44     public Queue JavaDoc getQueue()
45         throws JMSException JavaDoc
46     {
47         return queue;
48     }
49
50     protected SomniDestination getDestination()
51     {
52         return queue;
53     }
54
55     public String JavaDoc getName()
56     {
57         return name;
58     }
59 }
60
61 /* Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 David Walend
62 All rights reserved.
63
64 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
65
66 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
67
68 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
69
70 Neither the name of the SomnifugiJMS Project, walend.net, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission from David Walend.
71
72 Credits in redistributions in source or binary forms must include a link to http://somnifugi.sourceforge.net .
73
74 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
75 The net.walend.somnifugi.sql92 package is modified code from the openmq project, https://mq.dev.java.net/ , Copyright (c) of Sun, and carries the CDDL license, repeated here: You can obtain a copy of the license at https://glassfish.dev.java.net/public/CDDLv1.0.html. See the License for the specific language governing permissions and limitations under the License.
76
77 =================================================================================
78
79 For more information and the latest version of this software, please see http://somnifugi.sourceforge.net and http://walend.net or email <a HREF="mailto:david@walend.net">david@walend.net</a>.
80  */

81
Popular Tags