//
// JmsaXATopicConnectionFactory.java - JMS Adapter XATopicConnectionFactory
//
// JmsaCF handles the "administered" object side of things.
//

package nyangau.jmsadapter;

import java.util.Map;
import javax.jms.*;

public class JmsaXATopicConnectionFactory extends JmsaCF implements XATopicConnectionFactory
  {
  protected transient XATopicConnectionFactory cf;
//...sJmsaXATopicConnectionFactory:2:
// The JmsaXATopicConnectionFactory isn't registered in JNDI,
// its being directly created, given an underlying TopicConnectionFactory and Map.
// The map contains
//   no naming properties (if present, they'll be ignored)
//   no underlying TopicConnectionFactory name (if present, it'll be ignored)
//   JMS Adapter properties
public JmsaXATopicConnectionFactory(XATopicConnectionFactory connfact, Map<String,Object> map)
  {
  super(map);
  cf = connfact;
  }

// We get called here when reconstructed from a Reference in JNDI,
// or a JNDI configuration tool is instantiating a CF
// The map contains
//   naming properties
//   underlying XATopicConnectionFactory name
//   JMS Adapter properties
public JmsaXATopicConnectionFactory(Map<String,Object> map)
  {
  super(map);
  cf = null;
  }
public JmsaXATopicConnectionFactory(Map<String,Object> map, Map<String,Object> map2)
  {
  super(map, map2);
  cf = null;
  }

// We get called here when unserialised from JNDI
// The map contains
//   naming properties
//   underlying TopicConnectionFactory name
//   JMS Adapter properties
public JmsaXATopicConnectionFactory()
  {
  cf = null;
  }
//...e
  // from ConnectionFactory
//...screateConnection:2:
public Connection createConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaConnection( cf.createConnection(), getFlowProcessor() );
  }

public Connection createConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaConnection( cf.createConnection(userName, password), getFlowProcessor() );
  }
//...e
  // from TopicConnectionFactory
//...screateTopicConnection:2:
public TopicConnection createTopicConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaTopicConnection( cf.createTopicConnection(), getFlowProcessor() );
  }

public TopicConnection createTopicConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaTopicConnection( cf.createTopicConnection(userName, password), getFlowProcessor() );
  }
//...e
  // from XAConnectionFactory
//...screateXAConnection:2:
public XAConnection createXAConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaXAConnection( cf.createXAConnection(), getFlowProcessor() );
  }

public XAConnection createXAConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaXAConnection( cf.createXAConnection(userName, password), getFlowProcessor() );
  }
//...e
  // from XATopicConnectionFactory
//...screateXATopicConnection:2:
public XATopicConnection createXATopicConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaXATopicConnection( cf.createXATopicConnection(), getFlowProcessor() );
  }

public XATopicConnection createXATopicConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XATopicConnectionFactory) findFactory();
  return new JmsaXATopicConnection( cf.createXATopicConnection(userName, password), getFlowProcessor() );
  }
//...e
  }
