Class DataSourceFactory
java.lang.Object
org.frankframework.jdbc.datasource.ObjectFactory<CommonDataSource>
org.frankframework.jdbc.datasource.DataSourceFactory
- All Implemented Interfaces:
IDataSourceFactory
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
PoolingDataSourceFactory
public class DataSourceFactory
extends ObjectFactory<CommonDataSource>
implements IDataSourceFactory
Factory through which (TX-enabled) DataSources can be retrieved.
Default implementation, does not use pooling, wraps the DataSource in a TransactionAwareDataSourceProxy.
-
Field Summary
Fields inherited from class org.frankframework.jdbc.datasource.ObjectFactory
log
Fields inherited from interface org.frankframework.jdbc.IDataSourceFactory
DEFAULT_DATASOURCE_NAME_PROPERTY, GLOBAL_DEFAULT_DATASOURCE_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final DataSource
augment
(CommonDataSource dataSource, String dataSourceName) Ensure that the outermost DataSource proxy/wrapper in the chain is theTransactionAwareDataSourceProxy
.protected DataSource
augmentDatasource
(CommonDataSource dataSource, String dataSourceName) Allow implementing classes to augment the DataSource.getDataSource
(String dataSourceName) Look up a DataSource from the JNDIgetDataSource
(String dataSourceName, Properties environment) Set the JNDI environment to use for JNDI lookups.Return all known/registered DataSourcesMethods inherited from class org.frankframework.jdbc.datasource.ObjectFactory
add, afterPropertiesSet, destroy, get, getObjectNames, setObjectLocators
-
Constructor Details
-
DataSourceFactory
public DataSourceFactory()
-
-
Method Details
-
augmentDatasource
Allow implementing classes to augment the DataSource. Seeaugment(CommonDataSource, String)
. -
augment
Ensure that the outermost DataSource proxy/wrapper in the chain is theTransactionAwareDataSourceProxy
. Otherwise theTransactionAwareDataSourceProxy
will NOT work!- Overrides:
augment
in classObjectFactory<CommonDataSource>
-
getDataSource
Description copied from interface:IDataSourceFactory
Look up a DataSource from the JNDI- Specified by:
getDataSource
in interfaceIDataSourceFactory
-
getDataSource
Description copied from interface:IDataSourceFactory
Set the JNDI environment to use for JNDI lookups.Uses a Spring JndiTemplate with the given environment settings.
- Specified by:
getDataSource
in interfaceIDataSourceFactory
- See Also:
-
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate)
-
getDataSourceNames
Description copied from interface:IDataSourceFactory
Return all known/registered DataSources- Specified by:
getDataSourceNames
in interfaceIDataSourceFactory
-