org.objectweb.medor.datasource.lib

Class ConnectionFactoryDataStore

Implemented Interfaces:
DataStore

public class ConnectionFactoryDataStore
extends BasicDataStore

This implementation of the DataStore interface could be used in all cases where a data store could be identified by a connection factory. The reference is not typed in order to support various connection factory ( javax.sql.Datasource, javax.resource.cci.ConnectionFactory, ...)

Author:
S.Chassande-Barrioz

Field Summary

protected Object
connectionFactory

Fields inherited from interface org.objectweb.medor.datasource.api.DataStore

JDBC_STORE, MEDORTC_STORE, ODMG_STORE, TEXTFILE_STORE, UDDI_STORE, XMLDOCUMENT_STORE

Constructor Summary

ConnectionFactoryDataStore(short dataStoreType, String sourceName, short[] capabilities, Object cf)
It builds a ConnectionFactoryDataStore.

Method Summary

Object
getConnectionFactory()
boolean
isSameAs(DataStore ds)
Two ConnectionFactoryDataStore with the same connection factory are equals.

Methods inherited from class org.objectweb.medor.datasource.lib.BasicDataStore

getClientName, getDataStoreType, getName, isCapable, isSameAs, setClientName

Field Details

connectionFactory

protected Object connectionFactory

Constructor Details

ConnectionFactoryDataStore

public ConnectionFactoryDataStore(short dataStoreType,
                                  String sourceName,
                                  short[] capabilities,
                                  Object cf)
            throws DataSourceException
It builds a ConnectionFactoryDataStore.

Parameters:
dataStoreType - is the type of the DataStore (ex: DataStore.JDBC_STORE)
sourceName - is the name of the datastore
capabilities - is the capabilities of the datastore
cf - is the connection factory (cannot be null)

Throws:
DataSourceException - if the specified connection factory is null.

Method Details

getConnectionFactory

public Object getConnectionFactory()


isSameAs

public boolean isSameAs(DataStore ds)
Two ConnectionFactoryDataStore with the same connection factory are equals.
Specified by:
isSameAs in interface DataStore
Overrides:
isSameAs in interface BasicDataStore