/*
 * JBoss, the OpenSource J2EE webOS
 * 
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.test.deployers.rar.mcf1;

import java.io.PrintWriter;
import java.util.Set;

import javax.resource.ResourceException;
import javax.resource.spi.ConnectionManager;
import javax.resource.spi.ConnectionRequestInfo;
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.ManagedConnectionFactory;
import javax.security.auth.Subject;

public class MCF1ManagedConnectionFactory implements ManagedConnectionFactory
{
   /** The serialVersionUID */
   private static final long serialVersionUID = 1L;

   public Object createConnectionFactory() throws ResourceException
   {
      return null;
   }

   public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
   {
      return new MCF1ConnectionFactoryImpl(cxManager);
   }

   public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
   {
      return new MCF1ManagedConnection(this);
   }

   public PrintWriter getLogWriter() throws ResourceException
   {
      return null;
   }

   public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
   {
      return (ManagedConnection) connectionSet.iterator().next();
   }

   public void setLogWriter(PrintWriter out) throws ResourceException
   {
   }

}
