1 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 ; 24 import javax.jms.XAConnection ; 25 import javax.jms.XAConnectionFactory ; 26 import javax.jms.XAQueueConnection ; 27 import javax.jms.XAQueueConnectionFactory ; 28 import javax.jms.XATopicConnection ; 29 import javax.jms.XATopicConnectionFactory ; 30 31 import java.net.URI ; 32 33 38 public class ActiveMQXAConnectionFactory extends ActiveMQConnectionFactory implements XAConnectionFactory , XAQueueConnectionFactory , XATopicConnectionFactory { 39 40 public ActiveMQXAConnectionFactory() { 41 } 42 43 public ActiveMQXAConnectionFactory(String userName, String password, String brokerURL) { 44 super(userName, password, brokerURL); 45 } 46 47 public ActiveMQXAConnectionFactory(String userName, String password, URI brokerURL) { 48 super(userName, password, brokerURL); 49 } 50 51 public ActiveMQXAConnectionFactory(String brokerURL) { 52 super(brokerURL); 53 } 54 55 public ActiveMQXAConnectionFactory(URI brokerURL) { 56 super(brokerURL); 57 } 58 59 public XAConnection createXAConnection() throws JMSException { 60 return (XAConnection ) createActiveMQConnection(); 61 } 62 63 public XAConnection createXAConnection(String userName, String password) throws JMSException { 64 return (XAConnection ) createActiveMQConnection(userName, password); 65 } 66 67 public XAQueueConnection createXAQueueConnection() throws JMSException { 68 return (XAQueueConnection ) createActiveMQConnection(); 69 } 70 71 public XAQueueConnection createXAQueueConnection(String userName, String password) throws JMSException { 72 return (XAQueueConnection ) createActiveMQConnection(userName, password); 73 } 74 75 public XATopicConnection createXATopicConnection() throws JMSException { 76 return (XATopicConnection ) createActiveMQConnection(); 77 } 78 79 public XATopicConnection createXATopicConnection(String userName, String password) throws JMSException { 80 return (XATopicConnection ) createActiveMQConnection(userName, password); 81 } 82 83 protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { 84 ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), stats); 85 return connection; 86 } 87 } 88 | Popular Tags |