KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > client > jms > ha > local > XATopicHALocalConnectionFactory


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  */

23 package org.objectweb.joram.client.jms.ha.local;
24
25 import org.objectweb.joram.client.jms.XAConnection;
26 import org.objectweb.joram.client.jms.XATopicConnection;
27 import org.objectweb.joram.client.jms.Connection;
28 import org.objectweb.joram.client.jms.TopicConnection;
29
30 import javax.naming.NamingException JavaDoc;
31
32 /**
33  * An <code>XATopicHALocalConnectionFactory</code> instance is a factory of
34  * local connections for XA Pub/Sub HA communication.
35  */

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

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

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

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

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

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

104   public static javax.jms.XATopicConnectionFactory JavaDoc create()
105   {
106     return new XATopicHALocalConnectionFactory();
107   }
108 }
109
Popular Tags