PoolUtils.checkMinIdle
- TimerTask checkMinIdle(ObjectPool!(T) pool, int minIdle, long period)
- TimerTask checkMinIdle(KeyedObjectPool!(K, V) keyedPool, K key, int minIdle, long period)
- Map!(K, TimerTask) checkMinIdle(KeyedObjectPool!(K, V) keyedPool, Collection!(K) keys, int minIdle, long period)
class PoolUtils
static
Map!(K, TimerTask)
checkMinIdle
hunt pool PoolUtils PoolUtils
constructorsstatic functions
Periodically check the idle object count for each key in the <code>Collection</code> <code>keys</code> in the keyedPool. At most one idle object will be added per period.
@param keyedPool the keyedPool to check periodically. @param keys a collection of keys to check the idle object count. @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 a {@link Map} of key and {@link TimerTask} pairs that will periodically check the pools idle object count. @throws IllegalArgumentException when <code>keyedPool</code>, <code>keys</code>, or any of the values in the collection 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)} . @see #checkMinIdle(KeyedObjectPool, Object, int, long)