public class JndiDataSourceFactory extends JndiObjectFactory<DataSource,CommonDataSource> implements IDataSourceFactory
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DATASOURCE_NAME_PROPERTY |
static String |
GLOBAL_DEFAULT_DATASOURCE_NAME |
log, objects
Constructor and Description |
---|
JndiDataSourceFactory() |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
augment(CommonDataSource dataSource,
String dataSourceName)
Ensure that the outermost DataSource proxy/wrapper in the chain is the
TransactionAwareDataSourceProxy . |
protected DataSource |
augmentDatasource(CommonDataSource dataSource,
String dataSourceName) |
DataSource |
getDataSource(String dataSourceName)
Look up a DataSource from the JNDI
|
DataSource |
getDataSource(String dataSourceName,
Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.
|
List<String> |
getDataSourceNames()
Return all known/registered DataSources
|
lookup, setApplicationContext
add, destroy, get, get
public static final String DEFAULT_DATASOURCE_NAME_PROPERTY
public static final String GLOBAL_DEFAULT_DATASOURCE_NAME
protected DataSource augmentDatasource(CommonDataSource dataSource, String dataSourceName)
protected final DataSource augment(CommonDataSource dataSource, String dataSourceName)
TransactionAwareDataSourceProxy
.
Otherwise the TransactionAwareDataSourceProxy
will NOT work!augment
in class ObjectFactoryBase<DataSource,CommonDataSource>
public DataSource getDataSource(String dataSourceName) throws NamingException
IDataSourceFactory
getDataSource
in interface IDataSourceFactory
NamingException
public DataSource getDataSource(String dataSourceName, Properties jndiEnvironment) throws NamingException
IDataSourceFactory
Uses a Spring JndiTemplate with the given environment settings.
getDataSource
in interface IDataSourceFactory
NamingException
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate)
public List<String> getDataSourceNames()
IDataSourceFactory
getDataSourceNames
in interface IDataSourceFactory
Copyright © 2023 Frank!Framework. All rights reserved.