| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.jdbc.datasource.lookup.MapDataSourceLookup
public class MapDataSourceLookup
Simple DataSourceLookup implementation that relies on a map for doing lookups.
 
Useful for testing environments or applications that need to match arbitrary
 String names to target DataSource objects.
| Constructor Summary | |
|---|---|
| MapDataSourceLookup()Create a new instance of the MapDataSourceLookupclass. | |
| MapDataSourceLookup(Map dataSources)Create a new instance of the MapDataSourceLookupclass. | |
| MapDataSourceLookup(String dataSourceName,
                    DataSource dataSource)Create a new instance of the MapDataSourceLookupclass. | |
| Method Summary | |
|---|---|
|  void | addDataSource(String dataSourceName,
              DataSource dataSource)Add the supplied DataSourceto the map ofDataSourcesmaintained by this object. | 
|  DataSource | getDataSource(String dataSourceName)Retrieve the DataSource identified by the given name. | 
|  Map | getDataSources()Get the MapofDataSourcesmaintained by this object. | 
|  void | setDataSources(Map dataSources)Set the MapofDataSources; the keys
 areStrings, the values are actualDataSourceinstances. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public MapDataSourceLookup()
MapDataSourceLookup class.
public MapDataSourceLookup(Map dataSources)
MapDataSourceLookup class.
dataSources - the Map of DataSources; the keys
 are Strings, the values are actual DataSource instances.
public MapDataSourceLookup(String dataSourceName,
                           DataSource dataSource)
MapDataSourceLookup class.
dataSourceName - the name under which the supplied DataSource is to be addeddataSource - the DataSource to be added| Method Detail | 
|---|
public void setDataSources(Map dataSources)
Map of DataSources; the keys
 are Strings, the values are actual DataSource instances.
 If the supplied Map is null, then this method
 call effectively has no effect.
dataSources - said Map of DataSourcespublic Map getDataSources()
Map of DataSources maintained by this object.
 The returned Map is unmodifiable.
Map of DataSources (never null)
public void addDataSource(String dataSourceName,
                          DataSource dataSource)
DataSource to the map of DataSources
 maintained by this object.
dataSourceName - the name under which the supplied DataSource is to be addeddataSource - the DataSource to be so added
public DataSource getDataSource(String dataSourceName)
                         throws DataSourceLookupFailureException
DataSourceLookup
getDataSource in interface DataSourceLookupdataSourceName - the name of the DataSource
null)
DataSourceLookupFailureException - if the lookup failed| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||