KickJava   Java API By Example, From Geeks To Geeks.

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


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.TopicConnectionFactory</code> interface.
31  */

32 public abstract class TopicConnectionFactory
33                       extends ConnectionFactory
34                       implements javax.jms.TopicConnectionFactory JavaDoc
35 {
36   /**
37    * Constructs a <code>TopicConnectionFactory</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 TopicConnectionFactory(String JavaDoc host, int port)
44     {
45       super(host, port);
46     }
47
48   /**
49    * Constructs a <code>TopicConnectionFactory</code> dedicated to a given server.
50    *
51    * @param url joram ha url.
52    */

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

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

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

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