//
// JmsaXAQueueConnectionFactory.java - JMS Adapter XAQueueConnectionFactory
//
// JmsaCF handles the "administered" object side of things.
//

package nyangau.jmsadapter;

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

public class JmsaXAQueueConnectionFactory extends JmsaCF implements XAQueueConnectionFactory
  {
  protected transient XAQueueConnectionFactory cf;
//...sJmsaXAQueueConnectionFactory:2:
// The JmsaXAQueueConnectionFactory isn't registered in JNDI,
// its being directly created, given an underlying QueueConnectionFactory and Map.
// The map contains
//   no naming properties (if present, they'll be ignored)
//   no underlying QueueConnectionFactory name (if present, it'll be ignored)
//   JMS Adapter properties
public JmsaXAQueueConnectionFactory(XAQueueConnectionFactory 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 XAQueueConnectionFactory name
//   JMS Adapter properties
public JmsaXAQueueConnectionFactory(Map<String,Object> map)
  {
  super(map);
  cf = null;
  }
public JmsaXAQueueConnectionFactory(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 QueueConnectionFactory name
//   JMS Adapter properties
public JmsaXAQueueConnectionFactory()
  {
  cf = null;
  }
//...e
  // from ConnectionFactory
//...screateConnection:2:
public Connection createConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaConnection( cf.createConnection(), getFlowProcessor() );
  }

public Connection createConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaConnection( cf.createConnection(userName, password), getFlowProcessor() );
  }
//...e
  // from QueueConnectionFactory
//...screateQueueConnection:2:
public QueueConnection createQueueConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaQueueConnection( cf.createQueueConnection(), getFlowProcessor() );
  }

public QueueConnection createQueueConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaQueueConnection( cf.createQueueConnection(userName, password), getFlowProcessor() );
  }
//...e
  // from XAConnectionFactory
//...screateXAConnection:2:
public XAConnection createXAConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaXAConnection( cf.createXAConnection(), getFlowProcessor() );
  }

public XAConnection createXAConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaXAConnection( cf.createXAConnection(userName, password), getFlowProcessor() );
  }
//...e
  // from XAQueueConnectionFactory
//...screateXAQueueConnection:2:
public XAQueueConnection createXAQueueConnection()
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaXAQueueConnection( cf.createXAQueueConnection(), getFlowProcessor() );
  }

public XAQueueConnection createXAQueueConnection(String userName, String password)
  throws JMSException
  {
  if ( cf == null )
    cf = (XAQueueConnectionFactory) findFactory();
  return new JmsaXAQueueConnection( cf.createXAQueueConnection(userName, password), getFlowProcessor() );
  }
//...e
  }
