1 18 package org.apache.activemq; 19 20 import javax.jms.JMSException ; 21 import javax.jms.Session ; 22 import javax.jms.XAConnection ; 23 import javax.jms.XAQueueConnection ; 24 import javax.jms.XAQueueSession ; 25 import javax.jms.XASession ; 26 import javax.jms.XATopicConnection ; 27 import javax.jms.XATopicSession ; 28 29 import org.apache.activemq.management.JMSStatsImpl; 30 import org.apache.activemq.transport.Transport; 31 import org.apache.activemq.util.IdGenerator; 32 33 52 public class ActiveMQXAConnection extends ActiveMQConnection implements XATopicConnection , XAQueueConnection , XAConnection { 53 54 protected ActiveMQXAConnection(Transport transport, IdGenerator clientIdGenerator, JMSStatsImpl factoryStats) throws Exception { 55 super(transport, clientIdGenerator, factoryStats); 56 } 57 58 public XASession createXASession() throws JMSException { 59 return (XASession ) createSession(true, Session.SESSION_TRANSACTED); 60 } 61 62 public XATopicSession createXATopicSession() throws JMSException { 63 return (XATopicSession ) createSession(true, Session.SESSION_TRANSACTED); 64 } 65 66 public XAQueueSession createXAQueueSession() throws JMSException { 67 return (XAQueueSession ) createSession(true, Session.SESSION_TRANSACTED); 68 } 69 70 public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException { 71 checkClosedOrFailed(); 72 ensureConnectionInfoSent(); 73 return new ActiveMQXASession(this, getNextSessionId(), Session.SESSION_TRANSACTED, dispatchAsync); 74 } 75 } 76 | Popular Tags |