//
// JmsaXATopicConnection.java - JMS Adapter XATopicConnection
//
// XATopicConnection extends XAConnection and TopicConnection,
// but we can't extend both JmsaXAConnection and JmsaTopicConnection in
// this implementation. So we extend one, and re-implement from the other.
//

package nyangau.jmsadapter;

import javax.jms.*;

public class JmsaXATopicConnection extends JmsaXAConnection implements XATopicConnection
  {
//...sJmsaXATopicConnection:2:
public JmsaXATopicConnection(XATopicConnection conn, FlowProcessor flowproc)
  { super(conn, flowproc); }
//...e
//...screateTopicSession:2:
// JMS 1.1 Javadoc says this returns a TopicSession and the Method Summary
// says its creates an XATopicSession object. This is a bit misleading as
// XATopicSession is an _interface_ and it does not extend TopicSession.

public TopicSession createTopicSession(boolean transacted, int acknowledgeMode)
  throws JMSException
  {
  JmsaTopicSession s = new JmsaTopicSession(
    ((XATopicConnection)c).createTopicSession(transacted, acknowledgeMode),
    this,
    fp
    );
  ss.add(s);
  return s;
  }
//...e
//...screateXATopicSession:2:
public XATopicSession createXATopicSession()
  throws JMSException
  {
  JmsaXATopicSession s = new JmsaXATopicSession(
    ((XATopicConnection)c).createXATopicSession(),
    this,
    fp
    );
  ss.add(s);
  return s;
  }
//...e
//...screateConnectionConsumer:2:
public ConnectionConsumer createConnectionConsumer(
  Topic queue,
  String messageSelector,
  ServerSessionPool sessionPool,
  int maxMessages
  )
  throws JMSException
  {
  return ((TopicConnection)c).createConnectionConsumer(
    (Topic) getDest(queue),
    messageSelector,
    sessionPool,
    maxMessages
    );
  }
//...e
//...screateDurableConnectionConsumer:2:
public ConnectionConsumer createDurableConnectionConsumer(
  Topic topic,
  String subscriptionName,
  String messageSelector,
  ServerSessionPool sessionPool,
  int maxMessages
  )
  throws JMSException
  {
  return ((TopicConnection)c).createDurableConnectionConsumer(
    (Topic) getDest(topic),
    subscriptionName,
    messageSelector,
    sessionPool,
    maxMessages
    );
  }
//...e
  }
