KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > client > jms > local > TopicLocalConnectionFactory


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2004 - Bull SA
4  * Copyright (C) 2004 - ScalAgent Distributed Technologies
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): David Feliot (ScalAgent DT)
22  * Contributor(s): Frederic Maistre (Bull SA)
23  */

24 package org.objectweb.joram.client.jms.local;
25
26 import org.objectweb.joram.client.jms.Connection;
27 import org.objectweb.joram.client.jms.TopicConnection;
28
29 import javax.naming.NamingException JavaDoc;
30
31 /**
32  * A <code>TopicLocalConnectionFactory</code> instance is a factory of
33  * local connections for Pub/Sub communication.
34  */

35 public class TopicLocalConnectionFactory
36     extends org.objectweb.joram.client.jms.TopicConnectionFactory {
37
38   /**
39    * Constructs an empty <code>TopicLocalConnectionFactory</code> instance.
40    */

41   public TopicLocalConnectionFactory()
42   {
43     super("localhost", -1);
44   }
45
46   /**
47    * Method inherited from the <code>TopicConnectionFactory</code> class.
48    *
49    * @exception JMSSecurityException If the user identification is incorrect.
50    */

51   public javax.jms.TopicConnection JavaDoc
52          createTopicConnection(String JavaDoc name, String JavaDoc password)
53          throws javax.jms.JMSException JavaDoc
54   {
55     LocalConnection lc = new LocalConnection(name, password);
56     return new TopicConnection(params, lc);
57   }
58
59   /**
60    * Method inherited from the <code>ConnectionFactory</code> class.
61    *
62    * @exception JMSSecurityException If the user identification is incorrect.
63    */

64   public javax.jms.Connection JavaDoc createConnection(String JavaDoc name, String JavaDoc password)
65                               throws javax.jms.JMSException JavaDoc
66   {
67     LocalConnection lc = new LocalConnection(name, password);
68     return new Connection(params, lc);
69   }
70
71
72   /**
73    * Admin method creating a <code>javax.jms.TopicConnectionFactory</code>
74    * instance for creating local connections.
75    */

76   public static javax.jms.TopicConnectionFactory JavaDoc create()
77   {
78     return new TopicLocalConnectionFactory();
79   }
80 }
81
Popular Tags