org.springframework.r2dbc.connection.lookup

## Class SingleConnectionFactoryLookup

- java.lang.Object
- - org.springframework.r2dbc.connection.lookup.SingleConnectionFactoryLookup

- All Implemented Interfaces:
    ConnectionFactoryLookup

      public class SingleConnectionFactoryLookup
      extends Object
      implements ConnectionFactoryLookup

  An implementation of `ConnectionFactoryLookup` that simply wraps a single given `ConnectionFactory` returned for any connection factory name.
  Since:
    5.3
  Author:
    Mark Paluch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SingleConnectionFactoryLookup(io.r2dbc.spi.ConnectionFactory connectionFactory)` Create a new instance of the `SingleConnectionFactoryLookup` class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `io.r2dbc.spi.ConnectionFactory` | `getConnectionFactory(String connectionFactoryName)` Retrieve the `ConnectionFactory` identified by the given name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SingleConnectionFactoryLookup

          public SingleConnectionFactoryLookup(io.r2dbc.spi.ConnectionFactory connectionFactory)

      Create a new instance of the `SingleConnectionFactoryLookup` class.
      Parameters:
        `connectionFactory` - the single `ConnectionFactory` to wrap

  - ### Method Detail

    - #### getConnectionFactory

          public io.r2dbc.spi.ConnectionFactory getConnectionFactory(String connectionFactoryName)
                                                              throws ConnectionFactoryLookupFailureException

      Description copied from interface: `ConnectionFactoryLookup`
      Retrieve the `ConnectionFactory` identified by the given name.
      Specified by:
        `getConnectionFactory` in interface `ConnectionFactoryLookup`
      Parameters:
        `connectionFactoryName` - the name of the `ConnectionFactory`
      Returns:
        the `ConnectionFactory` (never `null`)
      Throws:
        `ConnectionFactoryLookupFailureException` - if the lookup failed