//
// JmsaXAQueueConnection.java - JMS Adapter XAQueueConnection
//
// XAQueueConnection extends XAConnection and QueueConnection,
// but we can't extend both JmsaXAConnection and JmsaQueueConnection in
// this implementation. So we extend one, and re-implement from the other.
//

package nyangau.jmsadapter;

import javax.jms.*;

public class JmsaXAQueueConnection extends JmsaXAConnection implements XAQueueConnection
  {
//...sJmsaXAQueueConnection:2:
public JmsaXAQueueConnection(XAQueueConnection conn, FlowProcessor flowproc)
  { super(conn, flowproc); }
//...e
//...screateQueueSession:2:
// JMS 1.1 Javadoc says this returns a QueueSession and the Method Summary
// says its creates an XAQueueSession object. This is a bit misleading as
// XAQueueSession is an _interface_ and it does not extend QueueSession.

public QueueSession createQueueSession(boolean transacted, int acknowledgeMode)
  throws JMSException
  {
  JmsaQueueSession s = new JmsaQueueSession(
    ((XAQueueConnection)c).createQueueSession(transacted, acknowledgeMode),
    this,
    fp
    );
  ss.add(s);
  return s;
  }
//...e
//...screateXAQueueSession:2:
public XAQueueSession createXAQueueSession()
  throws JMSException
  {
  JmsaXAQueueSession s = new JmsaXAQueueSession(
    ((XAQueueConnection)c).createXAQueueSession(),
    this,
    fp
    );
  ss.add(s);
  return s;
  }
//...e
//...screateConnectionConsumer:2:
public ConnectionConsumer createConnectionConsumer(
  Queue queue,
  String messageSelector,
  ServerSessionPool sessionPool,
  int maxMessages
  )
  throws JMSException
  {
  return ((QueueConnection)c).createConnectionConsumer(
    (Queue) getDest(queue),
    messageSelector,
    sessionPool,
    maxMessages
    );
  }
//...e
  }
