@Immutable public class ConnectionPoolSettings extends java.lang.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(java.lang.Object o) |
java.util.List<ConnectionPoolListener> |
getConnectionPoolListeners()
Gets the list of added
ConnectionPoolListener . |
long |
getMaintenanceFrequency(java.util.concurrent.TimeUnit timeUnit)
Returns the time period between runs of the maintenance job.
|
long |
getMaintenanceInitialDelay(java.util.concurrent.TimeUnit timeUnit)
Returns the period of time to wait before running the first maintenance job on the connection pool.
|
long |
getMaxConnectionIdleTime(java.util.concurrent.TimeUnit timeUnit)
Returns the maximum idle time of a pooled connection.
|
long |
getMaxConnectionLifeTime(java.util.concurrent.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(java.util.concurrent.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() |
java.lang.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(java.util.concurrent.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(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic long getMaxConnectionIdleTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic long getMaintenanceInitialDelay(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic long getMaintenanceFrequency(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the TimeUnit to use for this time periodpublic java.util.List<ConnectionPoolListener> getConnectionPoolListeners()
ConnectionPoolListener
. The default is an empty list.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object