org.compass.core.lucene.engine.store.jdbc
Interface DataSourceProvider

All Known Implementing Classes:
AbstractDataSourceProvider, C3P0DataSourceProvider, DbcpDataSourceProvider, DriverManagerDataSourceProvider, ExternalDataSourceProvider, JndiDataSourceProvider

public interface DataSourceProvider

Resposible for providing a Jdbc DataSource for JdbcDirectoryStore.

The DataSource is a shared data source that should be used throughout the lifecycle of this class.

Author:
kimchy

Method Summary
 void closeDataSource()
          Closes the created data source.
 void configure(String url, CompassSettings settings)
          Configures the data source provider with the give settings and url, the configuration will control the DataSource that will be instansiated.
 DataSource getDataSource()
          Retuns an instance of the data source, as per the configuration set for it.
 

Method Detail

configure

void configure(String url,
               CompassSettings settings)
               throws CompassException
Configures the data source provider with the give settings and url, the configuration will control the DataSource that will be instansiated.

Parameters:
url - The jdbc url connection string
settings - The settings for the given data source provider (and the DataSource).
Throws:
CompassException

getDataSource

DataSource getDataSource()
Retuns an instance of the data source, as per the configuration set for it.

Note, that the instance should be created (either in the configure method, or lazily in this method), and shared for all repeating calls. This will also allow closeDataSource() to close the actual data source.


closeDataSource

void closeDataSource()
Closes the created data source.



Copyright (c) 2004-2009 The Compass Project.