public static final class ConnectionProvider.Builder extends ConnectionProvider.ConnectionPoolSpec<ConnectionProvider.Builder>
ConnectionProvider
to cache and reuse a fixed maximum number of
Connection
. Further connections will be pending acquisition depending on
pendingAcquireTime. The maximum number of connections is for the connections in a single
connection pool, where a connection pool corresponds to a concrete remote host.
The configuration can be either global for all connection pools or
be tuned for each individual connection pool, per remote host.Modifier and Type | Method and Description |
---|---|
ConnectionProvider |
build()
Builds new ConnectionProvider
|
ConnectionProvider.Builder |
forRemoteHost(SocketAddress remoteHost,
java.util.function.Consumer<ConnectionProvider.HostSpecificSpec> spec)
Connection pool configuration for a specific remote host.
|
ConnectionProvider.Builder |
name(String name)
ConnectionProvider name is used for metrics |
evictInBackground, fifo, get, lifo, maxConnections, maxIdleTime, maxLifeTime, metrics, metrics, pendingAcquireMaxCount, pendingAcquireTimeout
public final ConnectionProvider.Builder name(String name)
ConnectionProvider
name is used for metricsname
- ConnectionProvider
nameNullPointerException
- if name is nullpublic final ConnectionProvider.Builder forRemoteHost(SocketAddress remoteHost, java.util.function.Consumer<ConnectionProvider.HostSpecificSpec> spec)
remoteHost
- the remote hostspec
- connection pool configuration for a this remote hostNullPointerException
- if remoteHost or/and spec are nullpublic ConnectionProvider build()