KickJava   Java API By Example, From Geeks To Geeks.

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


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.XAConnection;
27 import org.objectweb.joram.client.jms.XATopicConnection;
28 import org.objectweb.joram.client.jms.Connection;
29 import org.objectweb.joram.client.jms.TopicConnection;
30
31 import javax.naming.NamingException JavaDoc;
32
33
34 /**
35  * An <code>XATopicLocalConnectionFactory</code> instance is a factory of
36  * local connections for XA Pub/Sub communication.
37  */

38 public class XATopicLocalConnectionFactory
39     extends org.objectweb.joram.client.jms.XATopicConnectionFactory
40 {
41   /**
42    * Constructs an <code>XATopicLocalConnectionFactory</code> instance.
43    */

44   public XATopicLocalConnectionFactory()
45   {
46     super("localhost", -1);
47   }
48
49
50   /**
51    * Method inherited from the <code>XATopicConnectionFactory</code> class..
52    *
53    * @exception JMSSecurityException If the user identification is incorrect.
54    */

55   public javax.jms.XATopicConnection JavaDoc
56       createXATopicConnection(String JavaDoc name, String JavaDoc password)
57     throws javax.jms.JMSException JavaDoc
58   {
59     LocalConnection lc = new LocalConnection(name, password);
60     return new XATopicConnection(params, lc);
61   }
62
63   /**
64    * Method inherited from the <code>XAConnectionFactory</code> class.
65    *
66    * @exception JMSSecurityException If the user identification is incorrect.
67    */

68   public javax.jms.XAConnection JavaDoc
69       createXAConnection(String JavaDoc name, String JavaDoc password)
70     throws javax.jms.JMSException JavaDoc
71   {
72     LocalConnection lc = new LocalConnection(name, password);
73     return new XAConnection(params, lc);
74   }
75
76   /**
77    * Method inherited from the <code>TopicConnectionFactory</code> class.
78    *
79    * @exception JMSSecurityException If the user identification is incorrect.
80    */

81   public javax.jms.TopicConnection JavaDoc
82       createTopicConnection(String JavaDoc name, String JavaDoc password)
83     throws javax.jms.JMSException JavaDoc
84   {
85     LocalConnection lc = new LocalConnection(name, password);
86     return new TopicConnection(params, lc);
87   }
88
89   /**
90    * Method inherited from the <code>ConnectionFactory</code> class.
91    *
92    * @exception JMSSecurityException If the user identification is incorrect.
93    * @exception IllegalStateException If the server is not listening.
94    */

95   public javax.jms.Connection JavaDoc createConnection(String JavaDoc name, String JavaDoc password)
96     throws javax.jms.JMSException JavaDoc
97   {
98     LocalConnection lc = new LocalConnection(name, password);
99     return new Connection(params, lc);
100   }
101
102
103   /**
104    * Admin method creating a <code>javax.jms.XATopicConnectionFactory</code>
105    * instance for creating local connections.
106    */

107   public static javax.jms.XATopicConnectionFactory JavaDoc create()
108   {
109     return new XATopicLocalConnectionFactory();
110   }
111 }
112
Popular Tags