PoolUtils.checkMinIdle
- TimerTask checkMinIdle(ObjectPool!(T) pool, int minIdle, long period)
- TimerTask checkMinIdle(KeyedObjectPool!(K, V) keyedPool, K key, int minIdle, long period)
class PoolUtils
static
TimerTask
checkMinIdle
- Map!(K, TimerTask) checkMinIdle(KeyedObjectPool!(K, V) keyedPool, Collection!(K) keys, int minIdle, long period)
hunt pool PoolUtils PoolUtils
constructorsstatic functions
Periodically check the idle object count for the key in the keyedPool. At most one idle object will be added per period. If there is an exception when calling {@link KeyedObjectPool#addObject(Object)} then no more checks for that key will be performed.
@param keyedPool the keyedPool to check periodically. @param key the key to check the idle count of. @param minIdle if the {@link KeyedObjectPool#getNumIdle(Object)} is less than this then add an idle object. @param period the frequency to check the number of idle objects in a keyedPool, see {@link Timer#schedule(TimerTask, long, long)}. @param <K> the type of the pool key @param <V> the type of pool entries @return the {@link TimerTask} that will periodically check the pools idle object count. @throws IllegalArgumentException when <code>keyedPool</code>, <code>key</code> is <code>null</code> or when <code>minIdle</code> is negative or when <code>period</code> isn't valid for {@link Timer#schedule(TimerTask, long, long)}.