Save This Page
Home » activemq-parent-5.3.1-source-release » org.apache » activemq » [javadoc | source]
    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *      http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   package org.apache.activemq;
   18   
   19   import java.net.URI;
   20   
   21   import javax.jms.JMSException;
   22   import javax.jms.XAConnection;
   23   import javax.jms.XAConnectionFactory;
   24   import javax.jms.XAQueueConnection;
   25   import javax.jms.XAQueueConnectionFactory;
   26   import javax.jms.XATopicConnection;
   27   import javax.jms.XATopicConnectionFactory;
   28   
   29   import org.apache.activemq.management.JMSStatsImpl;
   30   import org.apache.activemq.transport.Transport;
   31   
   32   /**
   33    * A factory of {@link XAConnection} instances
   34    * 
   35    * @version $Revision: 564057 $
   36    */
   37   public class ActiveMQXAConnectionFactory extends ActiveMQConnectionFactory implements XAConnectionFactory, XAQueueConnectionFactory, XATopicConnectionFactory {
   38   
   39       public ActiveMQXAConnectionFactory() {
   40       }
   41   
   42       public ActiveMQXAConnectionFactory(String userName, String password, String brokerURL) {
   43           super(userName, password, brokerURL);
   44       }
   45   
   46       public ActiveMQXAConnectionFactory(String userName, String password, URI brokerURL) {
   47           super(userName, password, brokerURL);
   48       }
   49   
   50       public ActiveMQXAConnectionFactory(String brokerURL) {
   51           super(brokerURL);
   52       }
   53   
   54       public ActiveMQXAConnectionFactory(URI brokerURL) {
   55           super(brokerURL);
   56       }
   57   
   58       public XAConnection createXAConnection() throws JMSException {
   59           return (XAConnection) createActiveMQConnection();
   60       }
   61   
   62       public XAConnection createXAConnection(String userName, String password) throws JMSException {
   63           return (XAConnection) createActiveMQConnection(userName, password);
   64       }
   65   
   66       public XAQueueConnection createXAQueueConnection() throws JMSException {
   67           return (XAQueueConnection) createActiveMQConnection();
   68       }
   69   
   70       public XAQueueConnection createXAQueueConnection(String userName, String password) throws JMSException {
   71           return (XAQueueConnection) createActiveMQConnection(userName, password);
   72       }
   73   
   74       public XATopicConnection createXATopicConnection() throws JMSException {
   75           return (XATopicConnection) createActiveMQConnection();
   76       }
   77   
   78       public XATopicConnection createXATopicConnection(String userName, String password) throws JMSException {
   79           return (XATopicConnection) createActiveMQConnection(userName, password);
   80       }
   81   
   82       protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception {
   83           ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), stats);
   84           return connection;
   85       }
   86   }

Save This Page
Home » activemq-parent-5.3.1-source-release » org.apache » activemq » [javadoc | source]