/**
 * 
 * Copyright 2004 Hiram Chirino
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 * 
 **/
package org.codehaus.activemq.ra;

import javax.jms.JMSException;

import org.codehaus.activemq.transport.TransportChannel;
import org.codehaus.activemq.*;
import org.codehaus.activemq.ActiveMQConnectionFactory;

/**
 * The ActiveMQRAConnection extends the ActiveMQXAConnection so 
 * that it is more flexible in terms of using the availble 
 * transaction context.  A normal ActiveMQXAConnection implements
 * the XAConnection interface stictly which means that it
 * can only do work in the context of an XA transaction. 
 *
 * @version $Revision: 1.1.2.1 $
 * @see javax.jms.Connection
 * @see javax.jms.ConnectionFactory
 * @see javax.jms.QueueConnection
 * @see javax.jms.TopicConnection
 * @see javax.jms.TopicConnectionFactory
 * @see javax.jms.QueueConnection
 * @see javax.jms.QueueConnectionFactory
 */
public class ActiveMQRAConnection extends ActiveMQXAConnection {

	public ActiveMQRAConnection(org.codehaus.activemq.ActiveMQConnectionFactory factory,
			String theUserName, String thePassword) throws JMSException {
		super(factory, theUserName, thePassword);
	}

	public ActiveMQRAConnection(ActiveMQConnectionFactory factory,
			String theUserName, String thePassword,
			TransportChannel transportChannel) throws JMSException {
		super(factory, theUserName, thePassword, transportChannel);
	}
	
    protected ActiveMQXASession createActiveMQXASession(int acknowledgeMode) throws JMSException {
        checkClosed();
        sendConnectionInfoToBroker();
        return new ActiveMQRASession(this, acknowledgeMode);
    }
}
