Class OptionsCapableConnectionFactory
java.lang.Object
org.springframework.boot.r2dbc.OptionsCapableConnectionFactory
- All Implemented Interfaces:
ConnectionFactory, Wrapped<ConnectionFactory>
public class OptionsCapableConnectionFactory
extends Object
implements Wrapped<ConnectionFactory>, ConnectionFactory
ConnectionFactory capable of providing access to the
ConnectionFactoryOptions from which it was built.- Since:
- 2.5.0
- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorsConstructorDescriptionOptionsCapableConnectionFactory(ConnectionFactoryOptions options, ConnectionFactory delegate) Create a newOptionsCapableConnectionFactorythat will provide access to the givenoptionsthat were used to build the givendelegateConnectionFactory. -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<? extends Connection> create()unwrap()unwrapFrom(ConnectionFactory connectionFactory) Returns, if possible, anOptionsCapableConnectionFactoryby unwrapping the givenconnectionFactoryas necessary.
-
Constructor Details
-
OptionsCapableConnectionFactory
public OptionsCapableConnectionFactory(ConnectionFactoryOptions options, ConnectionFactory delegate) Create a newOptionsCapableConnectionFactorythat will provide access to the givenoptionsthat were used to build the givendelegateConnectionFactory.- Parameters:
options- the options from which the connection factory was builtdelegate- the delegate connection factory that was built with options
-
-
Method Details
-
getOptions
-
create
- Specified by:
createin interfaceConnectionFactory
-
getMetadata
- Specified by:
getMetadatain interfaceConnectionFactory
-
unwrap
- Specified by:
unwrapin interfaceWrapped<ConnectionFactory>
-
unwrapFrom
public static @Nullable OptionsCapableConnectionFactory unwrapFrom(ConnectionFactory connectionFactory) Returns, if possible, anOptionsCapableConnectionFactoryby unwrapping the givenconnectionFactoryas necessary. If the givenconnectionFactorydoes not wrap anOptionsCapableConnectionFactoryand is not itself anOptionsCapableConnectionFactory,nullis returned.- Parameters:
connectionFactory- the connection factory to unwrap- Returns:
- the
OptionsCapableConnectionFactoryornull - Since:
- 2.5.1
-