public final class ConnectionPool extends Object
Address
may share a Connection
. This class implements the policy
of which connections to keep open for future use.Constructor and Description |
---|
ConnectionPool()
Create a new connection pool with tuning parameters appropriate for a single-user application.
|
ConnectionPool(int maxIdleConnections,
long keepAliveDuration,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
int |
connectionCount()
Returns total number of connections in the pool.
|
void |
evictAll()
Close and remove all idle connections in the pool.
|
int |
idleConnectionCount()
Returns the number of idle connections in the pool.
|
public ConnectionPool()
public ConnectionPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit)
public int idleConnectionCount()
public int connectionCount()
idleConnectionCount()
to count connections not currently
in use.public void evictAll()
Copyright © 2018. All rights reserved.