KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > presumo > jms > client > JmsQueueConnection


1 /**
2  * This file is part of Presumo.
3  *
4  * Presumo is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Presumo is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Presumo; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  *
19  * Copyright 2001 Dan Greff
20  */

21 package com.presumo.jms.client;
22
23 import javax.jms.JMSException JavaDoc;
24 import javax.jms.QueueConnection JavaDoc;
25 import javax.jms.QueueSession JavaDoc;
26 import javax.jms.ConnectionConsumer JavaDoc;
27 import javax.jms.ServerSessionPool JavaDoc;
28 import javax.jms.Queue JavaDoc;
29 import javax.jms.Session JavaDoc;
30
31 import com.presumo.jms.resources.Resources;
32 import com.presumo.jms.router.Router;
33 import com.presumo.util.log.Logger;
34 import com.presumo.util.log.LoggerFactory;
35
36  /**
37   * @see javax.jms.QueueConnection
38   */

39 public class JmsQueueConnection
40   extends JmsConnection implements QueueConnection JavaDoc
41 {
42
43     /////////////////////////////////////////////////////////////////////////
44
// Constructors //
45
/////////////////////////////////////////////////////////////////////////
46

47   public JmsQueueConnection(Router router)
48   {
49     super(router);
50   }
51   
52   public JmsQueueConnection(Router router, String JavaDoc host, int port)
53       throws JMSException JavaDoc
54   {
55     super(router, host, port);
56   }
57
58     ///////////////////////////////////////////////////////////////////////////
59
// Public Methods //
60
///////////////////////////////////////////////////////////////////////////
61

62   public synchronized QueueSession JavaDoc
63   createQueueSession(boolean transacted, int acknowledgeMode)
64     throws JMSException JavaDoc
65   {
66     logger.entry("createQueueSession");
67
68     /** Uncomment when JmsQueueSession is checked in
69     QueueSession retval = null;
70       new JmsQueueSession(router, transacted, acknowledgeMode);
71       
72     sessions.add(retval);
73       
74     if (started)
75       retval.start();
76     
77     logger.exit("createQueueSession");
78     return retval;
79     **/
return null;
80   }
81
82
83   /**
84    * Not implemented.
85    */

86   public ConnectionConsumer JavaDoc createConnectionConsumer(Queue JavaDoc topic,
87                                                      String JavaDoc messageSelector,
88                                                      ServerSessionPool JavaDoc sessionPool,
89                                                      int maxMessages)
90     throws JMSException JavaDoc
91   {
92     throw new IllegalStateException JavaDoc("Operation not permited");
93   }
94
95
96   ////////////////////////////// Misc stuff ////////////////////////////////
97
private static Logger logger =
98     LoggerFactory.getLogger(JmsQueueConnection.class, Resources.getBundle());
99   ///////////////////////////////////////////////////////////////////////////
100

101 }
102
103
104
105
Popular Tags