public class ConnectionPool extends Object implements ConnectionFactory, Disposable, Closeable, Wrapped<ConnectionFactory>
Disposable.Composite, Disposable.Swap| Constructor and Description |
|---|
ConnectionPool(ConnectionPoolConfiguration configuration)
Creates a new connection factory.
|
| Modifier and Type | Method and Description |
|---|---|
Mono<Void> |
close() |
Mono<Connection> |
create() |
void |
dispose() |
Mono<Void> |
disposeLater()
Dispose this
ConnectionPool in non-blocking flow. |
ConnectionFactoryMetadata |
getMetadata() |
Optional<PoolMetrics> |
getMetrics()
Returns
PoolMetrics if available. |
protected ObjectName |
getPoolObjectName(String name)
Construct JMX
ObjectName. |
boolean |
isDisposed() |
String |
toString() |
ConnectionFactory |
unwrap() |
Mono<Integer> |
warmup()
Warms up the
ConnectionPool, if needed. |
public ConnectionPool(ConnectionPoolConfiguration configuration)
configuration - the configuration to use for building the connection pool.IllegalArgumentException - if configuration is nullpublic Mono<Integer> warmup()
ConnectionPool, if needed. This instructs the pool to check for a minimum size and allocate
necessary connections when the minimum is not reached.Mono that triggers resource warmup and emits the number of warmed up resources.public Mono<Connection> create()
create in interface ConnectionFactorypublic void dispose()
dispose in interface Disposablepublic Mono<Void> disposeLater()
ConnectionPool in non-blocking flow.
When multiple errors occurred during dispose flow, they are added as suppressed errors onto the first error.
public boolean isDisposed()
isDisposed in interface Disposablepublic ConnectionFactoryMetadata getMetadata()
getMetadata in interface ConnectionFactorypublic ConnectionFactory unwrap()
unwrap in interface Wrapped<ConnectionFactory>public Optional<PoolMetrics> getMetrics()
PoolMetrics if available.protected ObjectName getPoolObjectName(String name) throws MalformedObjectNameException
ObjectName.name - connection pool nameObjectNameMalformedObjectNameException - when invalid objectname is constructedCopyright © 2023. All rights reserved.