DataSourceLookup implementation based on a Spring BeanFactory.
Will lookup Spring managed beans identified by bean name,
expecting them to be of type javax.sql.DataSource.
org.springframework.beans.factory.BeanFactory
| Modifier and Type | Field and Description |
|---|---|
| private BeanFactory |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BeanFactoryDataSourceLookup(BeanFactory
the bean factory to be used to lookup beanFactory)DataSourcesCreate a new instance of the |
| Modifier and Type | Method and Description |
|---|---|
| public DataSource | getDataSource(String
the name of the DataSource dataSourceName)Implements org. |
| public void | setBeanFactory(BeanFactory
owning BeanFactory (never beanFactory)null).
The bean can immediately call methods on the factory.Implements org. |
| beanFactory | back to summary |
|---|---|
| private BeanFactory beanFactory
| |
| BeanFactoryDataSourceLookup | back to summary |
|---|---|
| public BeanFactoryDataSourceLookup() Create a new instance of the The BeanFactory to access must be set via
| |
| BeanFactoryDataSourceLookup | back to summary |
|---|---|
| public BeanFactoryDataSourceLookup(BeanFactory beanFactory) Create a new instance of the Use of this constructor is redundant if this object is being created
by a Spring IoC container, as the supplied
| |
| getDataSource | back to summary |
|---|---|
| public DataSource getDataSource(String dataSourceName) throws DataSourceLookupFailureException Implements org. Doc from org. Retrieve the DataSource identified by the given name.
| |
| setBeanFactory | back to summary |
|---|---|
| public void setBeanFactory(BeanFactory beanFactory) Implements org. Doc from org. Callback that supplies the owning factory to a bean instance. Invoked after the population of normal bean properties
but before an initialization callback such as
| |