1 28 29 package com.caucho.jca.cfg; 30 31 import com.caucho.config.Config; 32 import com.caucho.config.ConfigException; 33 import com.caucho.util.L10N; 34 35 import javax.resource.spi.ManagedConnectionFactory ; 36 37 40 public class ConnectionDefinition extends ObjectConfig { 41 private static final L10N L = new L10N(ConnectionDefinition.class); 42 43 private Class _managedConnectionFactoryClass; 44 private Class _connectionFactoryInterface; 45 private String _connectionFactoryImplClass; 46 private Class _connectionInterface; 47 private String _connectionImplClass; 48 49 public void setManagedconnectionfactoryClass(Class cl) 50 throws ConfigException 51 { 52 Config.checkCanInstantiate(cl); 53 54 if (! ManagedConnectionFactory .class.isAssignableFrom(cl)) 55 throw new ConfigException(L.l("`{0}' must implement ManagedConnectionFactory. managedconnectionfactory-class must implement javax.resource.spi.ManagedConnectionFactory.")); 56 57 _managedConnectionFactoryClass = cl; 58 59 setType(cl); 60 } 61 62 public Class getManagedConnectionFactoryClass() 63 { 64 return _managedConnectionFactoryClass; 65 } 66 67 70 public void setConnectionfactoryInterface(Class cl) 71 throws ConfigException 72 { 73 _connectionFactoryInterface = cl; 74 } 75 76 79 public Class getConnectionFactoryInterface() 80 { 81 return _connectionFactoryInterface; 82 } 83 84 87 public void setConnectionfactoryImplClass(String cl) 88 throws ConfigException 89 { 90 _connectionFactoryImplClass = cl; 91 } 92 93 96 public void setConnectionInterface(Class cl) 97 throws ConfigException 98 { 99 _connectionInterface = cl; 100 } 101 102 105 public Class getConnectionInterface() 106 { 107 return _connectionInterface; 108 } 109 110 113 public void setConnectionImplClass(String cl) 114 throws ConfigException 115 { 116 _connectionImplClass = cl; 117 } 118 } 119 | Popular Tags |