Class SingleDataSourceLookup
- java.lang.Object
- org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup
- All Implemented Interfaces:
DataSourceLookup
public class SingleDataSourceLookup extends Object implements DataSourceLookup
An implementation of the DataSourceLookup that simply wraps a single given DataSource, returned for any data source name.- Since:
- 2.0
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description SingleDataSourceLookup(DataSource dataSource)Create a new instance of theSingleDataSourceLookupclass.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSourcegetDataSource(String dataSourceName)Retrieve the DataSource identified by the given name.
Constructor Detail
SingleDataSourceLookup
public SingleDataSourceLookup(DataSource dataSource)
Create a new instance of theSingleDataSourceLookupclass.- Parameters:
dataSource- the singleDataSourceto wrap
Method Detail
getDataSource
public DataSource getDataSource(String dataSourceName)
Description copied from interface:DataSourceLookupRetrieve the DataSource identified by the given name.- Specified by:
getDataSourcein interfaceDataSourceLookup- Parameters:
dataSourceName- the name of the DataSource- Returns:
- the DataSource (never
null)