KickJava   Java API By Example, From Geeks To Geeks.

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


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): Frederic Maistre (INRIA)
22  * Contributor(s): ScalAgent Distributed Technologies
23  * Benoit Pelletier (Bull SA)
24  */

25 package org.objectweb.joram.client.jms;
26
27 import javax.jms.JMSException JavaDoc;
28
29 /**
30  * Implements the <code>javax.jms.QueueConnectionFactory</code> interface.
31  */

32 public abstract class QueueConnectionFactory
33                       extends ConnectionFactory
34                       implements javax.jms.QueueConnectionFactory JavaDoc
35 {
36   /**
37    * Constructs a <code>QueueConnectionFactory</code> dedicated to a given
38    * server.
39    *
40    * @param host Name or IP address of the server's host.
41    * @param port Server's listening port.
42    */

43   public QueueConnectionFactory(String JavaDoc host, int port)
44     {
45       super(host, port);
46     }
47
48   /**
49    * Constructs a <code>QueueConnectionFactory</code> dedicated to a given server.
50    *
51    * @param url joram ha url.
52    */

53   public QueueConnectionFactory(String JavaDoc url) {
54     super(url);
55   }
56
57   /**
58    * Constructs an empty <code>QueueConnectionFactory</code>.
59    */

60   public QueueConnectionFactory()
61     {}
62
63
64   /** Returns a string view of the connection factory. */
65   public String JavaDoc toString()
66     {
67       return "QCF:" + params.getHost() + "-" + params.getPort();
68     }
69
70   /**
71    * API method, implemented according to the communication protocol.
72    *
73    * @exception JMSSecurityException If the user identification is incorrect.
74    * @exception IllegalStateException If the server is not listening.
75    */

76   public abstract javax.jms.QueueConnection JavaDoc
77       createQueueConnection(String JavaDoc name, String JavaDoc password)
78     throws JMSException JavaDoc;
79
80   /**
81    * API method.
82    *
83    * @exception JMSSecurityException If the default identification is
84    * incorrect.
85    * @exception IllegalStateException If the server is not listening.
86    */

87   public javax.jms.QueueConnection JavaDoc createQueueConnection() throws JMSException JavaDoc
88     {
89       return createQueueConnection(getDefaultLogin(), getDefaultPassword());
90     }
91 }
92
Popular Tags