public class BeanFactoryConnectionFactoryLookup extends Object implements ConnectionFactoryLookup, org.springframework.beans.factory.BeanFactoryAware
ConnectionFactoryLookup implementation based on a
Spring BeanFactory.
Will lookup Spring managed beans identified by bean name,
expecting them to be of type ConnectionFactory.
BeanFactory| Constructor and Description |
|---|
BeanFactoryConnectionFactoryLookup()
Create a new instance of the
BeanFactoryConnectionFactoryLookup class. |
BeanFactoryConnectionFactoryLookup(org.springframework.beans.factory.BeanFactory beanFactory)
Create a new instance of the
BeanFactoryConnectionFactoryLookup class. |
| Modifier and Type | Method and Description |
|---|---|
io.r2dbc.spi.ConnectionFactory |
getConnectionFactory(String connectionFactoryName)
Retrieve the
ConnectionFactory identified by the given name. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
public BeanFactoryConnectionFactoryLookup()
BeanFactoryConnectionFactoryLookup class.
The BeanFactory to access must be set via setBeanFactory.
public BeanFactoryConnectionFactoryLookup(org.springframework.beans.factory.BeanFactory beanFactory)
BeanFactoryConnectionFactoryLookup class.
Use of this constructor is redundant if this object is being created
by a Spring IoC container, as the supplied BeanFactory will be
replaced by the BeanFactory that creates it (c.f. the
BeanFactoryAware contract). So only use this constructor if you
are using this class outside the context of a Spring IoC container.
beanFactory - the bean factory to be used to lookup ConnectionFactoriespublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwarepublic io.r2dbc.spi.ConnectionFactory getConnectionFactory(String connectionFactoryName) throws ConnectionFactoryLookupFailureException
ConnectionFactoryLookupConnectionFactory identified by the given name.getConnectionFactory in interface ConnectionFactoryLookupconnectionFactoryName - the name of the ConnectionFactoryConnectionFactory (never null)ConnectionFactoryLookupFailureException - if the lookup failed