1 22 package org.jboss.resource.adapter.jms; 23 24 import javax.resource.ResourceException ; 25 import javax.resource.spi.ConnectionManager ; 26 import javax.resource.spi.ManagedConnectionFactory ; 27 import javax.resource.spi.ConnectionRequestInfo ; 28 import javax.resource.spi.ManagedConnection ; 29 30 import org.jboss.logging.Logger; 31 32 42 public class JmsConnectionManager 43 implements ConnectionManager 44 { 45 private static final long serialVersionUID = -3638293323045716739L; 46 47 private static final Logger log = Logger.getLogger(JmsConnectionManager.class); 48 49 52 public JmsConnectionManager() { 53 super(); 54 } 55 56 65 public Object allocateConnection(ManagedConnectionFactory mcf, 66 ConnectionRequestInfo cxRequestInfo) 67 throws ResourceException 68 { 69 boolean trace = log.isTraceEnabled(); 70 if (trace) 71 log.trace("Allocating connection; mcf=" + mcf + ", cxRequestInfo=" + cxRequestInfo); 72 73 ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo); 74 Object c = mc.getConnection(null, cxRequestInfo); 75 76 if (trace) 77 log.trace("Allocated connection: " + c + ", with managed connection: " + mc); 78 79 return c; 80 } 81 } 82 | Popular Tags |