1 23 package org.objectweb.medor.datasource.lib; 24 25 import org.objectweb.medor.api.DataSourceException; 26 import org.objectweb.medor.datasource.api.DataStore; 27 28 36 public class ConnectionFactoryDataStore extends BasicDataStore { 37 protected Object connectionFactory; 38 39 48 public ConnectionFactoryDataStore(short dataStoreType, 49 String sourceName, 50 short[] capabilities, 51 Object cf) 52 throws DataSourceException { 53 super(dataStoreType, sourceName, capabilities); 54 if (cf == null) 55 throw new DataSourceException("Invalid connection factory reference"); 56 connectionFactory = cf; 57 } 58 59 public Object getConnectionFactory() { 60 return connectionFactory; 61 } 62 63 66 public boolean isSameAs(DataStore ds) { 67 return (ds instanceof ConnectionFactoryDataStore) 68 && ((ConnectionFactoryDataStore) ds).connectionFactory.equals(connectionFactory); 69 } 70 } 71 | Popular Tags |