KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > client > jms > ha > tcp > XAHATcpConnectionFactory


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

24 package org.objectweb.joram.client.jms.ha.tcp;
25
26 import org.objectweb.joram.client.jms.*;
27
28 /**
29  * An <code>XAHATcpConnectionFactory</code> instance is a factory of
30  * tcp connections dedicated to XA HA communication.
31  */

32 public class XAHATcpConnectionFactory
33   extends org.objectweb.joram.client.jms.XAConnectionFactory {
34
35   /**
36    * Constructs an <code>XAHATcpConnectionFactory</code> instance.
37    */

38   public XAHATcpConnectionFactory(String JavaDoc url) {
39     super(url);
40   }
41
42
43   /**
44    * Method inherited from the <code>XAConnectionFactory</code> class.
45    *
46    * @exception JMSSecurityException If the user identification is incorrect.
47    */

48   public javax.jms.XAConnection JavaDoc
49       createXAConnection(String JavaDoc name, String JavaDoc password)
50     throws javax.jms.JMSException JavaDoc {
51       HATcpConnection lc = new HATcpConnection(
52         params.getUrl(), params, name, password, reliableClass);
53       return new XAConnection(params, lc);
54     }
55
56   /**
57    * Admin method creating a <code>javax.jms.XAConnectionFactory</code>
58    * instance for creating HA TCP connections with a given list of servers.
59    *
60    * @param url URL of the HA Joram server
61    */

62   public static javax.jms.XAConnectionFactory JavaDoc create(String JavaDoc url) {
63     return create(url, "org.objectweb.joram.client.jms.tcp.ReliableTcpClient");
64   }
65
66   /**
67    * Admin method creating a <code>javax.jms.XAConnectionFactory</code>
68    * instance for creating HA TCP connections with a given list of servers.
69    *
70    * @param url URL of the HA Joram server
71    * @param reliableClass Reliable class name.
72    */

73   public static javax.jms.XAConnectionFactory JavaDoc
74       create(String JavaDoc url, String JavaDoc reliableClass) {
75     XAHATcpConnectionFactory cf = new XAHATcpConnectionFactory(url);
76     cf.setReliableClass(reliableClass);
77     return cf;
78   }
79 }
80
Popular Tags