1 package org.openejb.core; 2 3 import javax.naming.NamingException ; 4 import javax.resource.spi.ConnectionManager ; 5 import javax.resource.spi.ManagedConnectionFactory ; 6 7 import org.openejb.core.ivm.naming.Reference; 8 17 public class ConnectorReference implements Reference{ 18 private ConnectionManager conMngr; 19 private ManagedConnectionFactory mngedConFactory; 20 21 public ConnectorReference(ConnectionManager cm, ManagedConnectionFactory mcf){ 22 conMngr = cm; 23 mngedConFactory = mcf; 24 } 25 public Object getObject( ) throws NamingException { 26 try{ 27 return mngedConFactory.createConnectionFactory(conMngr); 28 }catch(javax.resource.ResourceException re){ 29 throw new javax.naming.NamingException ("Could not create ConnectionFactory from "+mngedConFactory.getClass()); 30 } 31 32 } 33 } | Popular Tags |