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)
PruneStrategy
prune
in interface PruneStrategy
conn
- that is available for pruningpublic int getStatisticsSize()
PruneStrategy
PooledConnectionStatistics
.getStatisticsSize
in interface PruneStrategy
public long getPrunePeriod()
PruneStrategy
getPrunePeriod
in interface PruneStrategy
public 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 © 2016. All rights reserved.