KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > serverless > QueueReceiverImpl


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.jms.serverless;
8
9 import org.jboss.logging.Logger;
10 import javax.jms.Queue JavaDoc;
11 import javax.jms.QueueReceiver JavaDoc;
12 import javax.jms.JMSException JavaDoc;
13 import javax.jms.Destination JavaDoc;
14
15 /**
16  *
17  * @author Ovidiu Feodorov <ovidiu@jboss.org>
18  * @version $Revision: 1.1 $ $Date: 2004/04/15 22:54:19 $
19  *
20  **/

21 class QueueReceiverImpl extends MessageConsumerImpl implements QueueReceiver JavaDoc {
22
23     private static final Logger log = Logger.getLogger(TopicSubscriberImpl.class);
24
25     private String JavaDoc id;
26
27     /**
28      * @param id - the receiver id. The Session instance that owns this receiver instance
29      * guarantees id uniqueness during its lifetime.
30      **/

31     QueueReceiverImpl(SessionImpl session, String JavaDoc id, Queue JavaDoc queue) {
32
33         super(session, queue);
34         this.id = id;
35     }
36
37     public String JavaDoc getID() {
38         return id;
39     }
40
41     //
42
// MessageConsumer INTERFACE METHODS
43
//
44

45     public void close() throws JMSException JavaDoc {
46         setMessageListener(null);
47         session.removeConsumer(this);
48     }
49
50     //
51
// QueueReceiver INTERFACE IMPLEMENTATION
52
//
53

54     public Queue JavaDoc getQueue() throws JMSException JavaDoc {
55         return (Queue JavaDoc)getDestination();
56     }
57     
58 }
59
Popular Tags