|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.pool.IdlePruneStrategy
public class IdlePruneStrategy
Removes connections from the pool based on how long they have been idle in the available queue. By default this implementation executes every 5 minutes and prunes connections that have been idle for more than 10 minutes.
| Field Summary | |
|---|---|
protected org.slf4j.Logger |
logger
Logger for this class. |
| Constructor Summary | |
|---|---|
IdlePruneStrategy()
Creates a new idle prune strategy. |
|
IdlePruneStrategy(long period,
long idle)
Creates a new idle prune strategy. |
|
| Method Summary | |
|---|---|
long |
getIdleTime()
Returns the idle time. |
String |
getIdleTimeDuration()
Returns the idle time as a duration. |
long |
getPrunePeriod()
Returns the interval at which the prune task will be executed in seconds. |
String |
getPrunePeriodDuration()
Returns the prune period as a duration. |
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 |
setIdleTimeDuration(String time)
Sets the idle time. |
void |
setPrunePeriod(long period)
Sets the prune period. |
void |
setPrunePeriodDuration(String period)
Sets the prune period. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final org.slf4j.Logger logger
| Constructor Detail |
|---|
public IdlePruneStrategy()
public IdlePruneStrategy(long period,
long idle)
period - to execute the prune taskidle - time at which a connection should be pruned| Method Detail |
|---|
public boolean prune(PooledConnectionProxy conn)
prune in interface PruneStrategyconn - that is available for pruning
public int getStatisticsSize()
PooledConnectionStatistics.
getStatisticsSize in interface PruneStrategypublic long getPrunePeriod()
getPrunePeriod in interface PruneStrategypublic void setPrunePeriod(long period)
period - to setpublic String getPrunePeriodDuration()
public void setPrunePeriodDuration(String period)
period - in duration syntax or in secondspublic long getIdleTime()
public void setIdleTime(long time)
time - that a connection has been idle and should be prunedpublic String getIdleTimeDuration()
public void setIdleTimeDuration(String time)
time - in duration syntax or in secondspublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||