KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - 2006 ScalAgent Distributed Technologies
4  * Copyright (C) 1996 - 2000 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): ScalAgent Distributed Technologies
22  */

23 package org.objectweb.joram.client.jms;
24
25 import javax.jms.JMSException JavaDoc;
26 import javax.jms.MessageListener JavaDoc;
27
28 import org.objectweb.joram.client.jms.connection.RequestMultiplexer;
29 import org.objectweb.joram.shared.client.ConsumerMessages;
30 import org.objectweb.util.monolog.api.BasicLevel;
31
32 /**
33  *
34  */

35 public class SingleSessionConsumer extends MessageConsumerListener {
36   
37   private Session sess;
38
39   /**
40    *
41    */

42   SingleSessionConsumer(
43       boolean queueMode,
44       boolean durable,
45       String JavaDoc selector,
46       String JavaDoc targetName,
47       Session session,
48       MessageListener JavaDoc listener,
49       int queueMessageReadMax,
50       int topicActivationThreshold,
51       int topicPassivationThreshold,
52       int topicAckBufferMax,
53       RequestMultiplexer reqMultiplexer) {
54     super(queueMode, durable, selector, targetName,
55         listener, queueMessageReadMax,
56         topicActivationThreshold,
57         topicPassivationThreshold, topicAckBufferMax,
58         reqMultiplexer);
59     sess = session;
60   }
61   
62   
63   public void pushMessages(ConsumerMessages cm) throws JMSException JavaDoc {
64     sess.pushMessages(this, cm);
65   }
66   
67   public void onMessage(Message msg, MessageListener JavaDoc listener, int ackMode)
68     throws JMSException JavaDoc {
69     throw new Error JavaDoc("Invalid call");
70   }
71 }
72
Popular Tags