Class PooledDatasourceService
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.extensions.modules.connections.PooledDatasourceService
-
- All Implemented Interfaces:
org.pentaho.reporting.engine.classic.core.modules.misc.connections.DataSourceService
- Direct Known Subclasses:
PooledWithJndiDataSourceService
public class PooledDatasourceService extends Object implements org.pentaho.reporting.engine.classic.core.modules.misc.connections.DataSourceService
-
-
Constructor Summary
Constructors Constructor Description PooledDatasourceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()This method clears the JNDI DS cache.voidclearDataSource(String dsName)This method clears the JNDI DS cache.DataSourcegetDataSource(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.StringgetDSBoundName(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 DataSourcequeryFallback(String dataSource)protected DataSourceretrieve(String datasource)
-
-
-
Method Detail
-
retrieve
protected DataSource retrieve(String datasource) throws org.pentaho.reporting.engine.classic.core.modules.misc.connections.DatasourceServiceException
- Throws:
org.pentaho.reporting.engine.classic.core.modules.misc.connections.DatasourceServiceException
-
queryFallback
protected DataSource queryFallback(String dataSource)
-
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:
clearCachein interfaceorg.pentaho.reporting.engine.classic.core.modules.misc.connections.DataSourceService
-
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:
clearDataSourcein interfaceorg.pentaho.reporting.engine.classic.core.modules.misc.connections.DataSourceService
-
getDataSource
public DataSource getDataSource(String dsName) throws org.pentaho.reporting.engine.classic.core.modules.misc.connections.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.- Specified by:
getDataSourcein interfaceorg.pentaho.reporting.engine.classic.core.modules.misc.connections.DataSourceService- Parameters:
dsName- The Datasource name- Returns:
- DataSource if there is one bound in JNDI
- Throws:
org.pentaho.reporting.engine.classic.core.modules.misc.connections.DatasourceServiceException
-
getDSBoundName
public String getDSBoundName(String dsName) throws org.pentaho.reporting.engine.classic.core.modules.misc.connections.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, and return the actual bound name.- Specified by:
getDSBoundNamein interfaceorg.pentaho.reporting.engine.classic.core.modules.misc.connections.DataSourceService- Parameters:
dsName- The Datasource name (like SampleData)- Returns:
- The bound DS name if it is bound in JNDI (like "jdbc/SampleData")
- Throws:
org.pentaho.reporting.engine.classic.core.modules.misc.connections.DatasourceServiceException
-
-