public class BeanFactoryConnectionFactoryLookup extends Object implements ConnectionFactoryLookup, 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(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(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
public BeanFactoryConnectionFactoryLookup()
BeanFactoryConnectionFactoryLookup class.
The BeanFactory to access must be set via setBeanFactory.
public BeanFactoryConnectionFactoryLookup(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(BeanFactory beanFactory)
BeanFactoryAwareInvoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet() or a custom init-method.
setBeanFactory in interface BeanFactoryAwarebeanFactory - owning BeanFactory (never null).
The bean can immediately call methods on the factory.BeanInitializationExceptionpublic 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