Class BaseDatasourceService
- java.lang.Object
-
- org.pentaho.platform.engine.services.connection.datasource.dbcp.BaseDatasourceService
-
- All Implemented Interfaces:
org.pentaho.platform.api.data.IDBDatasourceService
- Direct Known Subclasses:
JndiDatasourceService
,NonPooledDatasourceService
,NonPooledOrJndiDatasourceService
public abstract class BaseDatasourceService extends Object implements org.pentaho.platform.api.data.IDBDatasourceService
-
-
Field Summary
-
Fields inherited from interface org.pentaho.platform.api.data.IDBDatasourceService
ACCESS_TO_UNDERLYING_CONNECTION_ALLOWED, DEFAULT_AUTO_COMMIT, DEFAULT_CATALOG, DEFAULT_READ_ONLY, DEFAULT_TRANSACTION_ISOLATION, IDBDATASOURCE_SERVICE, INITIAL_SIZE, JDBC_DATASOURCE, JDBC_POOL, LOG_ABANDONED, MAX_ACTIVE_KEY, MAX_IDLE_KEY, MAX_OPEN_PREPARED_STATEMENTS, MAX_WAIT_KEY, MIN_IDLE_KEY, POOL_PREPARED_STATEMENTS, QUERY_KEY, REMOVE_ABANDONED, REMOVE_ABANDONED_TIMEOUT, TEST_ON_BORROW, TEST_ON_RETURN, TEST_WHILE_IDLE, TIME_BETWEEN_EVICTION_RUNS_MILLIS, TRANSACTION_ISOLATION_NONE_VALUE
-
-
Constructor Summary
Constructors Constructor Description BaseDatasourceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCache()
This method clears the JNDI DS cache.void
clearDataSource(String dsName)
This method clears the JNDI DS cache.org.pentaho.platform.api.engine.ICacheManager
getCacheManager()
DataSource
getDataSource(String dsName)
org.pentaho.platform.api.repository.datasource.IDatasourceMgmtService
getDatasourceMgmtService()
String
getDSBoundName(String dsName)
Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource.String
getDSUnboundName(String dsName)
Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource.protected DataSource
getJndiDataSource(String dsName)
DataSource
resolveDatabaseConnection(org.pentaho.database.model.IDatabaseConnection databaseConnection)
This should have been abstract, but changes to this API at a point release is not advised.protected DataSource
retrieve(String name)
This should have been abstract, but changes to this API at a point release is not advised.
-
-
-
Method Detail
-
clearCache
public void clearCache()
This method clears the JNDI DS cache. The need exists because after a JNDI connection edit the old DS must be removed from the cache.- Specified by:
clearCache
in interfaceorg.pentaho.platform.api.data.IDBDatasourceService
-
clearDataSource
public void clearDataSource(String dsName)
This method clears the JNDI DS cache. The need exists because after a JNDI connection edit the old DS must be removed from the cache.- Specified by:
clearDataSource
in interfaceorg.pentaho.platform.api.data.IDBDatasourceService
-
getDataSource
public DataSource getDataSource(String dsName) throws org.pentaho.platform.api.data.DBDatasourceServiceException
- Specified by:
getDataSource
in interfaceorg.pentaho.platform.api.data.IDBDatasourceService
- Throws:
org.pentaho.platform.api.data.DBDatasourceServiceException
-
retrieve
protected DataSource retrieve(String name) throws org.pentaho.platform.api.data.DBDatasourceServiceException
This should have been abstract, but changes to this API at a point release is not advised.- Parameters:
name
- name of JNDI reference- Returns:
- DataSource
- Throws:
org.pentaho.platform.api.data.DBDatasourceServiceException
-
resolveDatabaseConnection
public DataSource resolveDatabaseConnection(org.pentaho.database.model.IDatabaseConnection databaseConnection) throws org.pentaho.platform.api.data.DBDatasourceServiceException
This should have been abstract, but changes to this API at a point release is not advised.- Specified by:
resolveDatabaseConnection
in interfaceorg.pentaho.platform.api.data.IDBDatasourceService
- Parameters:
databaseConnection
-- Returns:
- Throws:
org.pentaho.platform.api.data.DBDatasourceServiceException
-
getJndiDataSource
protected DataSource getJndiDataSource(String dsName) throws org.pentaho.platform.api.data.DBDatasourceServiceException
- Throws:
org.pentaho.platform.api.data.DBDatasourceServiceException
-
getDSBoundName
public String getDSBoundName(String dsName) throws org.pentaho.platform.api.data.DBDatasourceServiceException
Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource. This method is intended to hide all the lookups that may be required to find a jndi name, and return the actual bound name.- Specified by:
getDSBoundName
in interfaceorg.pentaho.platform.api.data.IDBDatasourceService
- Parameters:
dsName
- The Datasource name (like SampleData)- Returns:
- The bound DS name if it is bound in JNDI (like "jdbc/SampleData")
- Throws:
org.pentaho.platform.api.data.DBDatasourceServiceException
-
getDSUnboundName
public String getDSUnboundName(String dsName)
Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource. This method is intended to extract just the regular name of a specified JNDI source.- Specified by:
getDSUnboundName
in interfaceorg.pentaho.platform.api.data.IDBDatasourceService
- Parameters:
dsName
- The Datasource name (like "jdbc/SampleData")- Returns:
- The unbound DS name (like "SampleData")
-
getCacheManager
public org.pentaho.platform.api.engine.ICacheManager getCacheManager()
-
getDatasourceMgmtService
public org.pentaho.platform.api.repository.datasource.IDatasourceMgmtService getDatasourceMgmtService()
-
-