KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - 2007 ScalAgent Distributed Technologies
4  * Copyright (C) 2007 France Telecom R&D
5  * Copyright (C) 1996 - 2000 Dyade
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA.
21  *
22  * Initial developer(s): Frederic Maistre (INRIA)
23  * Contributor(s): ScalAgent Distributed Technologies
24  * Benoit Pelletier (Bull SA)
25  */

26 package org.objectweb.joram.client.jms;
27
28 import javax.naming.*;
29 import javax.jms.JMSException JavaDoc;
30
31 import org.objectweb.joram.client.jms.admin.AbstractConnectionFactory;
32
33 import org.objectweb.util.monolog.api.BasicLevel;
34 import org.objectweb.joram.shared.JoramTracing;
35
36 /**
37  * Implements the <code>javax.jms.XAConnectionFactory</code> interface.
38  */

39 public abstract class XAConnectionFactory
40                 extends AbstractConnectionFactory
41                 implements javax.jms.XAConnectionFactory JavaDoc {
42   /**
43    * Constructs an <code>XAConnectionFactory</code> dedicated to a given
44    * server.
45    *
46    * @param host Name or IP address of the server's host.
47    * @param port Server's listening port.
48    */

49   public XAConnectionFactory(String JavaDoc host, int port) {
50     super(host, port);
51   }
52
53   /**
54    * Constructs an <code>XAConnectionFactory</code> dedicated to a given
55    * server.
56    *
57    * @param url joram ha url
58    */

59   public XAConnectionFactory(String JavaDoc url) {
60     super(url);
61   }
62
63   /**
64    * Constructs an empty <code>ConnectionFactory</code>.
65    */

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

81   public abstract javax.jms.XAConnection JavaDoc
82       createXAConnection(String JavaDoc name, String JavaDoc password) throws JMSException JavaDoc;
83
84   /**
85    * API method.
86    *
87    * @exception JMSSecurityException If the default identification is
88    * incorrect.
89    * @exception IllegalStateException If the server is not listening.
90    */

91   public javax.jms.XAConnection JavaDoc createXAConnection() throws JMSException JavaDoc {
92     return createXAConnection(getDefaultLogin(), getDefaultPassword());
93   }
94 }
95
Popular Tags