@Immutable public class ConnectionPoolSettings extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ConnectionPoolSettings.Builder
A builder for creating ConnectionPoolSettings.
|
Modifier and Type | Method and Description |
---|---|
static ConnectionPoolSettings.Builder |
builder()
Gets a Builder for creating a new ConnectionPoolSettings instance.
|
static ConnectionPoolSettings.Builder |
builder(ConnectionPoolSettings connectionPoolSettings)
Gets a Builder for creating a new ConnectionPoolSettings instance.
|
boolean |
equals(Object o) |
List<ConnectionPoolListener> |
getConnectionPoolListeners()
Gets the list of added
ConnectionPoolListener . |
long |
getMaintenanceFrequency(TimeUnit timeUnit)
Returns the time period between runs of the maintenance job.
|
long |
getMaintenanceInitialDelay(TimeUnit timeUnit)
Returns the period of time to wait before running the first maintenance job on the connection pool.
|
long |
getMaxConnectionIdleTime(TimeUnit timeUnit)
Returns the maximum idle time of a pooled connection.
|
long |
getMaxConnectionLifeTime(TimeUnit timeUnit)
The maximum time a pooled connection can live for.
|
int |
getMaxSize()
The maximum number of connections allowed.
|
int |
getMaxWaitQueueSize()
This is the maximum number of operations that may be waiting for a connection to become available from the pool.
|
long |
getMaxWaitTime(TimeUnit timeUnit)
The maximum time that a thread may wait for a connection to become available.
|
int |
getMinSize()
The minimum number of connections.
|
int |
hashCode() |
String |
toString() |
public static ConnectionPoolSettings.Builder builder()
public static ConnectionPoolSettings.Builder builder(ConnectionPoolSettings connectionPoolSettings)
connectionPoolSettings
- the existing connection pool settings to configure the builder withpublic int getMaxSize()
The maximum number of connections allowed. Those connections will be kept in the pool when idle. Once the pool is exhausted, any operation requiring a connection will block waiting for an available connection.
Default is 100.
public int getMinSize()
The minimum number of connections. Those connections will be kept in the pool when idle, and the pool will ensure that it contains at least this minimum number.
Default is 0.
public int getMaxWaitQueueSize()
This is the maximum number of operations that may be waiting for a connection to become available from the pool. All further operations will get an exception immediately.
Default is 500.
public long getMaxWaitTime(TimeUnit timeUnit)
The maximum time that a thread may wait for a connection to become available.
Default is 2 minutes. A value of 0 means that it will not wait. A negative value means it will wait indefinitely.
timeUnit
- the TimeUnit for this wait periodpublic long getMaxConnectionLifeTime(TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic long getMaxConnectionIdleTime(TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic long getMaintenanceInitialDelay(TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic long getMaintenanceFrequency(TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic List<ConnectionPoolListener> getConnectionPoolListeners()
ConnectionPoolListener
. The default is an empty list.