KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > ActiveMQXAConnectionFactory


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq;
19
20 import org.apache.activemq.management.JMSStatsImpl;
21 import org.apache.activemq.transport.Transport;
22
23 import javax.jms.JMSException JavaDoc;
24 import javax.jms.XAConnection JavaDoc;
25 import javax.jms.XAConnectionFactory JavaDoc;
26 import javax.jms.XAQueueConnection JavaDoc;
27 import javax.jms.XAQueueConnectionFactory JavaDoc;
28 import javax.jms.XATopicConnection JavaDoc;
29 import javax.jms.XATopicConnectionFactory JavaDoc;
30
31 import java.net.URI JavaDoc;
32
33 /**
34  * A factory of {@link XAConnection} instances
35  *
36  * @version $Revision: 426366 $
37  */

38 public class ActiveMQXAConnectionFactory extends ActiveMQConnectionFactory implements XAConnectionFactory JavaDoc, XAQueueConnectionFactory JavaDoc, XATopicConnectionFactory JavaDoc {
39
40     public ActiveMQXAConnectionFactory() {
41     }
42
43     public ActiveMQXAConnectionFactory(String JavaDoc userName, String JavaDoc password, String JavaDoc brokerURL) {
44         super(userName, password, brokerURL);
45     }
46
47     public ActiveMQXAConnectionFactory(String JavaDoc userName, String JavaDoc password, URI JavaDoc brokerURL) {
48         super(userName, password, brokerURL);
49     }
50
51     public ActiveMQXAConnectionFactory(String JavaDoc brokerURL) {
52         super(brokerURL);
53     }
54
55     public ActiveMQXAConnectionFactory(URI JavaDoc brokerURL) {
56         super(brokerURL);
57     }
58
59     public XAConnection JavaDoc createXAConnection() throws JMSException JavaDoc {
60         return (XAConnection JavaDoc) createActiveMQConnection();
61     }
62
63     public XAConnection JavaDoc createXAConnection(String JavaDoc userName, String JavaDoc password) throws JMSException JavaDoc {
64         return (XAConnection JavaDoc) createActiveMQConnection(userName, password);
65     }
66
67     public XAQueueConnection JavaDoc createXAQueueConnection() throws JMSException JavaDoc {
68         return (XAQueueConnection JavaDoc) createActiveMQConnection();
69     }
70
71     public XAQueueConnection JavaDoc createXAQueueConnection(String JavaDoc userName, String JavaDoc password) throws JMSException JavaDoc {
72         return (XAQueueConnection JavaDoc) createActiveMQConnection(userName, password);
73     }
74
75     public XATopicConnection JavaDoc createXATopicConnection() throws JMSException JavaDoc {
76         return (XATopicConnection JavaDoc) createActiveMQConnection();
77     }
78
79     public XATopicConnection JavaDoc createXATopicConnection(String JavaDoc userName, String JavaDoc password) throws JMSException JavaDoc {
80         return (XATopicConnection JavaDoc) createActiveMQConnection(userName, password);
81     }
82
83     protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception JavaDoc {
84         ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), stats);
85         return connection;
86     }
87 }
88
Popular Tags