KickJava   Java API By Example, From Geeks To Geeks.

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


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.QueueConnectionFactory JavaDoc;
24 import javax.jms.QueueConnection JavaDoc;
25 import javax.jms.JMSException JavaDoc;
26
27 import com.presumo.jms.resources.Resources;
28 import com.presumo.jms.router.Router;
29 import com.presumo.util.log.Logger;
30 import com.presumo.util.log.LoggerFactory;
31
32 /**
33  * @see javax.jms.QueueConnectionFactory
34  * @author Dan Greff
35  */

36 public class JmsQueueConnectionFactory extends JmsConnectionFactory
37     implements QueueConnectionFactory JavaDoc
38 {
39
40   
41     /////////////////////////////////////////////////////////////////////////
42
// Constructors //
43
/////////////////////////////////////////////////////////////////////////
44

45   public JmsQueueConnectionFactory()
46   {
47   }
48
49     /////////////////////////////////////////////////////////////////////////
50
// Public Methods //
51
/////////////////////////////////////////////////////////////////////////
52

53   public QueueConnection JavaDoc createQueueConnection() throws JMSException JavaDoc
54   {
55     logger.entry("createQueueConnection");
56     
57     QueueConnection JavaDoc retval = null;
58
59     Router r = getRouter();
60     if (host == null) {
61       retval = new JmsQueueConnection(r);
62     } else {
63       retval = new JmsQueueConnection(r, host, port);
64     }
65
66     logger.exit("createQueueConnection");
67     return retval;
68     
69   }
70
71   /**
72    * Functionality not implmented. Currently equivlant to
73    * calling <code>createQueueConnection()</code> without
74    * a <code>userName</code> and <code> password</code>.
75    *
76    * @see javax.jms.QueueConnectionFactory#createQueueConnection(String, String)
77    */

78   public QueueConnection JavaDoc createQueueConnection(String JavaDoc userName, String JavaDoc password)
79     throws JMSException JavaDoc
80   {
81     return createQueueConnection();
82   }
83
84   ////////////////////////////// Misc stuff ////////////////////////////////
85
private static Logger logger = LoggerFactory.getLogger
86     (JmsQueueConnectionFactory.class, Resources.getBundle());
87   ///////////////////////////////////////////////////////////////////////////
88

89 }
90
91
Popular Tags