Package org.openbravo.service.datasource
Class DataSourceServiceProvider
- java.lang.Object
-
- org.openbravo.service.datasource.DataSourceServiceProvider
-
@ApplicationScoped public class DataSourceServiceProvider extends Object
ProvidesDataSourceService
instances and caches them in a global cache.- Author:
- mtaal
-
-
Constructor Summary
Constructors Constructor Description DataSourceServiceProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSourceService
getDataSource(String dataSourceIdentifier)
Checks the internal cache for a datasource with the requested name and returns it if found.DataSourceService
getDataSource(String dataSourceIdentifier, boolean useCache)
Checks the internal cache for a datasource with the requested name and returns it if found.
-
-
-
Method Detail
-
getDataSource
public DataSourceService getDataSource(String dataSourceIdentifier)
Checks the internal cache for a datasource with the requested name and returns it if found. If not found a new one is created, which is cached and then returned.- Parameters:
dataSourceIdentifier
- the name by which to search and identify the data source.- Returns:
- a
DataSourceService
object
-
getDataSource
public DataSourceService getDataSource(String dataSourceIdentifier, boolean useCache)
Checks the internal cache for a datasource with the requested name and returns it if found. A second boolean parameter can be use to specify whether the datasource can be returned from a cache if available, or if a fresh, not-shared copy is expected- Parameters:
dataSourceIdentifier
- the name by which to search and identify the data source.useCache
- if true, the datasource will be read from a cache, if available. If false, a new instance will be created and will not be cached- Returns:
- a
DataSourceService
object
-
-