public class PoolConfig extends AbstractConfig
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_POOL_SIZE
Default max pool size, value is 10.
|
static int |
DEFAULT_MIN_POOL_SIZE
Default min pool size, value is 3.
|
static boolean |
DEFAULT_VALIDATE_ON_CHECKIN
Default validate on check in, value is false.
|
static boolean |
DEFAULT_VALIDATE_ON_CHECKOUT
Default validate on check out, value is false.
|
static Duration |
DEFAULT_VALIDATE_PERIOD
Default validate period, value is 30 minutes.
|
static boolean |
DEFAULT_VALIDATE_PERIODICALLY
Default validate periodically, value is false.
|
static Duration |
DEFAULT_VALIDATE_TIMEOUT
Default per connection validate timeout, value is 5 seconds.
|
private int |
maxPoolSize
Maximum pool size.
|
private int |
minPoolSize
Minimum pool size.
|
private boolean |
validateOnCheckIn
Whether the ldap object should be validated when returned to the pool.
|
private boolean |
validateOnCheckOut
Whether the ldap object should be validated when given from the pool.
|
private Duration |
validatePeriod
Time that the pool validation should repeat.
|
private boolean |
validatePeriodically
Whether the pool should be validated periodically.
|
private Duration |
validateTimeout
Maximum length of time a connection validation should block.
|
logger
Constructor and Description |
---|
PoolConfig() |
Modifier and Type | Method and Description |
---|---|
int |
getMaxPoolSize()
Returns the max pool size.
|
int |
getMinPoolSize()
Returns the min pool size.
|
Duration |
getValidatePeriod()
Returns the validate period.
|
Duration |
getValidateTimeout()
Returns the timeout imposed when validating a single connection.
|
boolean |
isValidateOnCheckIn()
Returns the validate on check in flag.
|
boolean |
isValidateOnCheckOut()
Returns the validate on check out flag.
|
boolean |
isValidatePeriodically()
Returns the validate periodically flag.
|
void |
setMaxPoolSize(int size)
Sets the max pool size.
|
void |
setMinPoolSize(int size)
Sets the min pool size.
|
void |
setValidateOnCheckIn(boolean b)
Sets the validate on check in flag.
|
void |
setValidateOnCheckOut(boolean b)
Sets the validate on check out flag.
|
void |
setValidatePeriod(Duration time)
Sets the period for which the pool will be validated.
|
void |
setValidatePeriodically(boolean b)
Sets the validate periodically flag.
|
void |
setValidateTimeout(Duration time)
Sets the timeout imposed when validating a single connection.
|
String |
toString() |
checkImmutable, checkStringInput, makeImmutable
public static final int DEFAULT_MIN_POOL_SIZE
public static final int DEFAULT_MAX_POOL_SIZE
public static final boolean DEFAULT_VALIDATE_ON_CHECKIN
public static final boolean DEFAULT_VALIDATE_ON_CHECKOUT
public static final boolean DEFAULT_VALIDATE_PERIODICALLY
public static final Duration DEFAULT_VALIDATE_PERIOD
public static final Duration DEFAULT_VALIDATE_TIMEOUT
private int minPoolSize
private int maxPoolSize
private boolean validateOnCheckIn
private boolean validateOnCheckOut
private boolean validatePeriodically
private Duration validatePeriod
private Duration validateTimeout
public int getMinPoolSize()
DEFAULT_MIN_POOL_SIZE
. This value represents the size of the
pool after a prune has occurred.public void setMinPoolSize(int size)
size
- min pool sizepublic int getMaxPoolSize()
DEFAULT_MAX_POOL_SIZE
. This value may or may not be strictly
enforced depending on the pooling implementation.public void setMaxPoolSize(int size)
size
- max pool sizepublic boolean isValidateOnCheckIn()
DEFAULT_VALIDATE_ON_CHECKIN
.public void setValidateOnCheckIn(boolean b)
b
- validate on check inpublic boolean isValidateOnCheckOut()
DEFAULT_VALIDATE_ON_CHECKOUT
.public void setValidateOnCheckOut(boolean b)
b
- validate on check outpublic boolean isValidatePeriodically()
DEFAULT_VALIDATE_PERIODICALLY
.public void setValidatePeriodically(boolean b)
b
- validate periodicallypublic Duration getValidatePeriod()
DEFAULT_VALIDATE_PERIOD
.public void setValidatePeriod(Duration time)
time
- in secondspublic Duration getValidateTimeout()
public void setValidateTimeout(Duration time)
time
- for a connection validationCopyright © 2003-2019 Virginia Tech. All Rights Reserved.