org.compass.core.lucene.engine.store.jdbc
Class ExternalDataSourceProvider

java.lang.Object
  extended by org.compass.core.lucene.engine.store.jdbc.AbstractDataSourceProvider
      extended by org.compass.core.lucene.engine.store.jdbc.ExternalDataSourceProvider
All Implemented Interfaces:
DataSourceProvider

public class ExternalDataSourceProvider
extends AbstractDataSourceProvider

A data source provider that can use an externally configured data source. In order to set the external DataSource to be used, the setDataSource(javax.sql.DataSource) static method needs to be called before the Compass instance is created.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.core.lucene.engine.store.jdbc.AbstractDataSourceProvider
autoCommit, driverClass, externalAutoCommit, password, username
 
Constructor Summary
ExternalDataSourceProvider()
           
 
Method Summary
 void closeDataSource()
          Closes the created data source.
protected  DataSource doCreateDataSource(String url, CompassSettings settings)
           
static void setDataSource(DataSource dataSource)
          Sets the external data source to be used.
 
Methods inherited from class org.compass.core.lucene.engine.store.jdbc.AbstractDataSourceProvider
configure, getDataSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalDataSourceProvider

public ExternalDataSourceProvider()
Method Detail

setDataSource

public static void setDataSource(DataSource dataSource)
Sets the external data source to be used. Must be set before creating the compass instance.


doCreateDataSource

protected DataSource doCreateDataSource(String url,
                                        CompassSettings settings)
                                 throws CompassException
Specified by:
doCreateDataSource in class AbstractDataSourceProvider
Throws:
CompassException

closeDataSource

public void closeDataSource()
Description copied from interface: DataSourceProvider
Closes the created data source.

Specified by:
closeDataSource in interface DataSourceProvider
Overrides:
closeDataSource in class AbstractDataSourceProvider


Copyright (c) 2004-2008 The Compass Project.