public class PoolOptions extends Object
Modifier and Type | Field and Description |
---|---|
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)
|
Constructor and Description |
---|
PoolOptions() |
PoolOptions(JsonObject json) |
PoolOptions(PoolOptions other) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getIdleTimeout() |
TimeUnit |
getIdleTimeoutUnit() |
int |
getMaxSize() |
int |
getMaxWaitQueueSize() |
int |
hashCode() |
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.
|
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 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 JsonObject toJson()
Copyright © 2021 Eclipse. All rights reserved.