Top Description Fields Constructors Methods
org.springframework.r2dbc.connection

public Class DelegatingConnectionFactory

extends Object
implements ConnectionFactory, Wrapped<ConnectionFactory>
Class Inheritance
All Implemented Interfaces
io.r2dbc.spi.Wrapped, io.r2dbc.spi.ConnectionFactory
Known Direct Subclasses
org.springframework.r2dbc.connection.SingleConnectionFactory, org.springframework.r2dbc.connection.TransactionAwareConnectionFactoryProxy
Imports
io.r2dbc.spi.Connection, .ConnectionFactory, .ConnectionFactoryMetadata, .Wrapped, reactor.core.publisher.Mono, org.springframework.util.Assert

R2DBC ConnectionFactory implementation that delegates all calls to a given target ConnectionFactory.

This class is meant to be subclassed, with subclasses overriding only those methods (such as create()) that should not simply delegate to the target ConnectionFactory.

Author
Mark Paluch
Since
5.3
See Also
create()

Field Summary

Modifier and TypeField and Description
private final ConnectionFactory

Constructor Summary

AccessConstructor and Description
public
DelegatingConnectionFactory(ConnectionFactory
the target ConnectionFactory
targetConnectionFactory
)

Create a new DelegatingConnectionFactory.

Method Summary

Modifier and TypeMethod and Description
public Mono<? extends Connection>
public ConnectionFactoryMetadata
getMetadata()

Implements io.r2dbc.spi.ConnectionFactory.getMetadata.

Returns the ConnectionFactoryMetadata about the product this ConnectionFactory is applicable to.

public ConnectionFactory
getTargetConnectionFactory()

Return the target ConnectionFactory that this ConnectionFactory delegates to.

public ConnectionFactory
unwrap()

Implements io.r2dbc.spi.Wrapped.unwrap.

Returns the original instance wrapped by this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

targetConnectionFactoryback to summary
private final ConnectionFactory targetConnectionFactory

Constructor Detail

DelegatingConnectionFactoryback to summary
public DelegatingConnectionFactory(ConnectionFactory targetConnectionFactory)

Create a new DelegatingConnectionFactory.

Parameters
targetConnectionFactory:ConnectionFactory

the target ConnectionFactory

Method Detail

createback to summary
public Mono<? extends Connection> create()

Implements io.r2dbc.spi.ConnectionFactory.create.

Doc from io.r2dbc.spi.ConnectionFactory.create.

Creates a new Connection.

Returns:Mono<? extends Connection>

the newly created Connection

Annotations
@Override
getMetadataback to summary
public ConnectionFactoryMetadata getMetadata()

Implements io.r2dbc.spi.ConnectionFactory.getMetadata.

Doc from io.r2dbc.spi.ConnectionFactory.getMetadata.

Returns the ConnectionFactoryMetadata about the product this ConnectionFactory is applicable to.

Returns:ConnectionFactoryMetadata

the ConnectionFactoryMetadata about the product this ConnectionFactory is applicable to

Annotations
@Override
getTargetConnectionFactoryback to summary
public ConnectionFactory getTargetConnectionFactory()

Return the target ConnectionFactory that this ConnectionFactory delegates to.

unwrapback to summary
public ConnectionFactory unwrap()

Implements io.r2dbc.spi.Wrapped.unwrap.

Doc from io.r2dbc.spi.Wrapped.unwrap.

Returns the original instance wrapped by this object.

Returns:ConnectionFactory

the original instance wrapped by this object

Annotations
@Override