public class DataSourceManager
extends java.lang.Object
DataSourceDefinition instances.
Act as a factory of DataSources, while maintaining a cache of any created
DataSources using given DataSourceDefinition as key. Each call to
getDataSource(DataSourceDefinition) will return the same DataSource
instance for equals definition.
To produce DataSource, this manager uses IDataSourceProviders for
each managed data sources. They are instantiated according the property
DataSourceSettingsEnvironment.DataSourceProvider#CLASS that define
the provider class to be instantiated for the given definition.
In order to actually release a DataSourceManager and every managed
DataSource, method release() must be
called.
This class is not public and is internal to oracle.odi.core package. It is internally used by OdiInstance class plus depreciated OdiPlatform class.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JDBC_RESOURCE_MONITOR_CLASS_PROPERTY |
| Constructor and Description |
|---|
DataSourceManager() |
DataSourceManager(int pDefaultLoginTimeout) |
| Modifier and Type | Method and Description |
|---|---|
javax.sql.DataSource |
getDataSource(oracle.odi.core.datasource.DataSourceDefinition pDefinition)
Creates or gets
DataSource for the specified
DataSourceDefinition. |
oracle.odi.core.datasource.monitoring.IJdbcResourceMonitor |
getJdbcResourceMonitor()
Returns the
IJdbcResourceMonitor used by this
DataSourceManager. |
void |
release()
Freeze all
DataSources held by this DataSourceManager. |
boolean |
release(oracle.odi.core.datasource.DataSourceDefinition pDefinition)
Release the given
DataSource if it is managed by this. |
public static final java.lang.String JDBC_RESOURCE_MONITOR_CLASS_PROPERTY
public DataSourceManager()
public DataSourceManager(int pDefaultLoginTimeout)
public oracle.odi.core.datasource.monitoring.IJdbcResourceMonitor getJdbcResourceMonitor()
IJdbcResourceMonitor used by this
DataSourceManager. The IJdbcResourceMonitor is created
during DataSourceManager instantiation by instantiating the class
name provided in "oracle.odi.core.DataSourceManager.JdbcResourceMonitor" system
property. If the property is not defined or the class name cannot be
instantiated correctly as a IJdbcResourceMonitor then no monitor
will be used.IJdbcResourceMonitor or null if no
IJdbcResourceMonitor is configuredpublic javax.sql.DataSource getDataSource(oracle.odi.core.datasource.DataSourceDefinition pDefinition)
DataSource for the specified
DataSourceDefinition.
Multiple call to this method with a same (or equals) data source
definition will always return the same DataSource instance.
Note:
pDefinition - the data source definitionDataSource for specified definitionpublic boolean release(oracle.odi.core.datasource.DataSourceDefinition pDefinition)
DataSource if it is managed by this.true if the DataSource has been released (i.e.
contained in this manager), false otherwisepublic void release()
DataSources held by this DataSourceManager.