public class IdlePruneStrategy extends Object implements PruneStrategy
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger
Logger for this class.
|
| Constructor and Description |
|---|
IdlePruneStrategy()
Creates a new idle prune strategy.
|
IdlePruneStrategy(long period,
long idle)
Creates a new idle prune strategy.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getIdleTime()
Returns the idle time.
|
long |
getPrunePeriod()
Returns the interval at which the prune task will be executed in seconds.
|
int |
getStatisticsSize()
Returns the number of statistics to store for this prune strategy.
|
boolean |
prune(PooledConnectionProxy conn)
Invoked to determine whether a connection should be pruned from the pool.
|
void |
setIdleTime(long time)
Sets the idle time.
|
void |
setPrunePeriod(long period)
Sets the prune period.
|
String |
toString() |
public IdlePruneStrategy()
public IdlePruneStrategy(long period,
long idle)
period - to execute the prune taskidle - time at which a connection should be prunedpublic boolean prune(PooledConnectionProxy conn)
PruneStrategyprune in interface PruneStrategyconn - that is available for pruningpublic int getStatisticsSize()
PruneStrategyPooledConnectionStatistics.getStatisticsSize in interface PruneStrategypublic long getPrunePeriod()
PruneStrategygetPrunePeriod in interface PruneStrategypublic void setPrunePeriod(long period)
period - to setpublic long getIdleTime()
public void setIdleTime(long time)
time - that a connection has been idle and should be prunedCopyright © 2023. All rights reserved.