KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - 2007 ScalAgent Distributed Technologies
4  * Copyright (C) 2007 France Telecom R&D
5  * Copyright (C) 1996 - 2000 Dyade
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA.
21  *
22  * Initial developer(s): Frederic Maistre (INRIA)
23  * Contributor(s): ScalAgent Distributed Technologies
24  * Benoit Pelletier (Bull SA)
25  */

26 package org.objectweb.joram.client.jms;
27
28 import javax.naming.*;
29 import javax.jms.JMSException JavaDoc;
30
31 import org.objectweb.joram.client.jms.admin.AbstractConnectionFactory;
32
33 import org.objectweb.util.monolog.api.BasicLevel;
34 import org.objectweb.joram.shared.JoramTracing;
35
36 /**
37  * Implements the <code>javax.jms.ConnectionFactory</code> interface.
38  */

39 public abstract class ConnectionFactory
40                 extends AbstractConnectionFactory
41                 implements javax.jms.ConnectionFactory JavaDoc {
42   /**
43    * Constructs a <code>ConnectionFactory</code> dedicated to a given server.
44    *
45    * @param host Name or IP address of the server's host.
46    * @param port Server's listening port.
47    */

48   public ConnectionFactory(String JavaDoc host, int port) {
49     super(host, port);
50   }
51
52   /**
53    * Constructs a <code>ConnectionFactory</code> dedicated to a given server.
54    *
55    * @param url joram ha url.
56    */

57   public ConnectionFactory(String JavaDoc url) {
58     super(url);
59   }
60
61   /**
62    * Constructs an empty <code>ConnectionFactory</code>.
63    */

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

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

89   public javax.jms.Connection JavaDoc createConnection() throws JMSException JavaDoc {
90     return createConnection(getDefaultLogin(), getDefaultPassword());
91   }
92 }
93
Popular Tags