KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - ScalAgent Distributed Technologies
4  * Copyright (C) 1996 - Dyade
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): Frederic Maistre (INRIA)
22  * Contributor(s): Nicolas Tachker (Bull SA)
23  */

24 package org.objectweb.joram.client.jms;
25
26 import javax.jms.IllegalStateException JavaDoc;
27 import javax.jms.JMSException JavaDoc;
28
29 import org.objectweb.joram.client.jms.connection.RequestChannel;
30
31 /**
32  * Implements the <code>javax.jms.XATopicConnection</code> interface.
33  */

34 public class XATopicConnection extends TopicConnection
35     implements javax.jms.XATopicConnection JavaDoc {
36
37   /** Resource manager instance. */
38   private XAResourceMngr rm;
39
40   /**
41    * Creates an <code>XATopicConnection</code> instance.
42    *
43    * @param factoryParameters The factory parameters.
44    * @param connectionImpl The actual connection to wrap.
45    *
46    * @exception JMSSecurityException If the user identification is incorrect.
47    * @exception IllegalStateException If the server is not listening.
48    */

49   public XATopicConnection(FactoryParameters factoryParameters,
50                            RequestChannel requestChannel) throws JMSException JavaDoc
51   {
52     super(factoryParameters, requestChannel);
53     rm = new XAResourceMngr(this);
54   }
55
56   /**
57    * API method.
58    *
59    * @exception IllegalStateException If the connection is closed.
60    * @exception JMSException In case of an invalid acknowledge mode.
61    */

62   public javax.jms.TopicSession JavaDoc
63          createTopicSession(boolean transacted, int acknowledgeMode)
64          throws JMSException JavaDoc {
65     return super.createTopicSession(transacted, acknowledgeMode);
66   }
67
68   /**
69    * API method.
70    *
71    * @exception IllegalStateException If the connection is closed.
72    */

73   public javax.jms.XATopicSession JavaDoc createXATopicSession() throws JMSException JavaDoc
74   {
75     checkClosed();
76     TopicSession s = new TopicSession(this, true, 0, getRequestMultiplexer());
77     XATopicSession xas = new XATopicSession(this, s, rm);
78     addSession(s);
79     return xas;
80   }
81
82   /**
83    * Method inherited from interface <code>XAConnection</code>.
84    *
85    * @exception IllegalStateException If the connection is closed.
86    * @exception JMSException In case of an invalid acknowledge mode.
87    */

88   public javax.jms.Session JavaDoc
89          createSession(boolean transacted, int acknowledgeMode)
90          throws JMSException JavaDoc {
91     return super.createSession(transacted, acknowledgeMode);
92   }
93
94   /**
95    * Method inherited from interface <code>XAConnection</code>.
96    *
97    * @exception IllegalStateException If the connection is closed.
98    */

99   public javax.jms.XASession JavaDoc createXASession() throws JMSException JavaDoc
100   {
101     checkClosed();
102     Session s = new Session(this, true, 0, getRequestMultiplexer());
103     XASession xas = new XASession(this, s, rm);
104     addSession(s);
105     return xas;
106   }
107
108   /**
109    * return XAResourceMngr of this connection.
110    * see connector
111    */

112   public XAResourceMngr getXAResourceMngr() {
113     return rm;
114   }
115 }
116
Popular Tags