org.pentaho.platform.engine.services.connection.datasource.dbcp
Class PooledOrJndiDatasourceService

java.lang.Object
  extended by org.pentaho.platform.engine.services.connection.datasource.dbcp.BaseDatasourceService
      extended by org.pentaho.platform.engine.services.connection.datasource.dbcp.PooledOrJndiDatasourceService
All Implemented Interfaces:
IDatasourceService
Direct Known Subclasses:
AbstractTenantAwareDatasourceService

public class PooledOrJndiDatasourceService
extends BaseDatasourceService


Field Summary
 
Fields inherited from interface org.pentaho.platform.api.data.IDatasourceService
IDATASOURCE_SERVICE, JDBC_DATASOURCE, JDBC_POOL
 
Constructor Summary
PooledOrJndiDatasourceService()
           
 
Method Summary
 void clearCache()
          This method clears the JNDI DS cache.
 void clearDataSource(String dsName)
          This method clears the JNDI DS cache.
 DataSource getDataSource(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.
 
Methods inherited from class org.pentaho.platform.engine.services.connection.datasource.dbcp.BaseDatasourceService
getDSBoundName, getDSUnboundName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PooledOrJndiDatasourceService

public PooledOrJndiDatasourceService()
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 interface IDatasourceService
Overrides:
clearCache in class BaseDatasourceService

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 interface IDatasourceService
Overrides:
clearDataSource in class BaseDatasourceService

getDataSource

public DataSource getDataSource(String dsName)
                         throws DatasourceServiceException
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.

Parameters:
dsName - The Datasource name
Returns:
DataSource if there is one bound in JNDI
Throws:
NamingException
DatasourceServiceException