public class PoolOptions extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT
Default connection timeout in the pool = 30 seconds
|
static TimeUnit |
DEFAULT_CONNECTION_TIMEOUT_TIME_UNIT
Default connection idle time unit in the pool = seconds
|
static int |
DEFAULT_IDLE_TIMEOUT
Default connection timeout in the pool = 0 (no timeout)
|
static TimeUnit |
DEFAULT_IDLE_TIMEOUT_TIME_UNIT
Default connection idle time unit in the pool = seconds
|
static int |
DEFAULT_MAX_SIZE
The default maximum number of connections a client will pool = 4
|
static int |
DEFAULT_MAX_WAIT_QUEUE_SIZE
Default max wait queue size = -1 (unbounded)
|
static int |
DEFAULT_POOL_CLEANER_PERIOD
Default pool cleaner period = 1000 ms (1 second)
|
Constructor and Description |
---|
PoolOptions() |
PoolOptions(JsonObject json) |
PoolOptions(PoolOptions other) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getConnectionTimeout() |
TimeUnit |
getConnectionTimeoutUnit() |
int |
getIdleTimeout() |
TimeUnit |
getIdleTimeoutUnit() |
int |
getMaxSize() |
int |
getMaxWaitQueueSize() |
int |
getPoolCleanerPeriod() |
int |
hashCode() |
PoolOptions |
setConnectionTimeout(int timeout)
Set the amount of time a client will wait for a connection from the pool.
|
PoolOptions |
setConnectionTimeoutUnit(TimeUnit timeoutUnit)
Set the time unit of
setConnectionTimeout(int) |
PoolOptions |
setIdleTimeout(int idleTimeout)
Establish an idle timeout for pooled connections.
|
PoolOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Establish an idle timeout unit for pooled connections.
|
PoolOptions |
setMaxSize(int maxSize)
Set the maximum pool size
|
PoolOptions |
setMaxWaitQueueSize(int maxWaitQueueSize)
Set the maximum connection request allowed in the wait queue, any requests beyond the max size will result in
an failure.
|
PoolOptions |
setPoolCleanerPeriod(int poolCleanerPeriod)
Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections
will remain in the pool until they are closed.
|
JsonObject |
toJson() |
public static final int DEFAULT_MAX_SIZE
public static final int DEFAULT_MAX_WAIT_QUEUE_SIZE
public static final int DEFAULT_IDLE_TIMEOUT
public static final TimeUnit DEFAULT_IDLE_TIMEOUT_TIME_UNIT
public static final int DEFAULT_POOL_CLEANER_PERIOD
public static final int DEFAULT_CONNECTION_TIMEOUT
public static final TimeUnit DEFAULT_CONNECTION_TIMEOUT_TIME_UNIT
public PoolOptions()
public PoolOptions(JsonObject json)
public PoolOptions(PoolOptions other)
public int getMaxSize()
public PoolOptions setMaxSize(int maxSize)
maxSize
- the maximum pool sizepublic int getMaxWaitQueueSize()
public PoolOptions setMaxWaitQueueSize(int maxWaitQueueSize)
maxWaitQueueSize
- the maximum number of waiting requestspublic TimeUnit getIdleTimeoutUnit()
public PoolOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
idleTimeoutUnit
- pooled connection idle time unitpublic int getIdleTimeout()
public PoolOptions setIdleTimeout(int idleTimeout)
idleTimeout
- the pool connection idle time unitqpublic int getPoolCleanerPeriod()
public PoolOptions setPoolCleanerPeriod(int poolCleanerPeriod)
poolCleanerPeriod
- the pool cleaner periodpublic TimeUnit getConnectionTimeoutUnit()
public PoolOptions setConnectionTimeoutUnit(TimeUnit timeoutUnit)
setConnectionTimeout(int)
timeoutUnit
- the time unitpublic int getConnectionTimeout()
setConnectionTimeout(int)
public PoolOptions setConnectionTimeout(int timeout)
timeout
- the pool connection idle time unitqpublic JsonObject toJson()
Copyright © 2021 Eclipse. All rights reserved.