/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param <T> the type of object * @param pool the ObjectPool to be decorated so it shrinks it's idle count when possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(ObjectPool, float) * @since Pool 1.4 */ public static <T> ObjectPool<T> erodingPool(final ObjectPool<T> pool) { return erodingPool(pool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param <K> the type of key * @param <V> the type of object * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float) * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static <K, V> KeyedObjectPool<K, V> erodingPool(final KeyedObjectPool<K, V> keyedPool) { return erodingPool(keyedPool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * <p> * The factor parameter provides a mechanism to tweak the rate at which the pool tries to shrink * it's size. Values between 0 and 1 cause the pool to try to shrink it's size more often. * Values greater than 1 cause the pool to less frequently try to shrink it's size. * </p> * * @param <K> the type of key * @param <V> the type of object * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @param factor a positive value to scale the rate at which the pool tries to reduce it's size. * If 0 < factor < 1 then the pool shrinks more aggressively. * If 1 < factor then the pool shrinks less aggressively. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static <K, V> KeyedObjectPool<K, V> erodingPool(final KeyedObjectPool<K, V> keyedPool, final float factor) { return erodingPool(keyedPool, factor, false); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param pool the ObjectPool to be decorated so it shrinks it's idle count when possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(ObjectPool, float) * @since Pool 1.4 */ public static ObjectPool erodingPool(final ObjectPool pool) { return erodingPool(pool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float) * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static KeyedObjectPool erodingPool(final KeyedObjectPool keyedPool) { return erodingPool(keyedPool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param <T> the type of object * @param pool the ObjectPool to be decorated so it shrinks it's idle count when possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(ObjectPool, float) * @since Pool 1.4 */ public static <T> ObjectPool<T> erodingPool(final ObjectPool<T> pool) { return erodingPool(pool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param pool the ObjectPool to be decorated so it shrinks it's idle count when possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(ObjectPool, float) * @since Pool 1.4 */ public static ObjectPool erodingPool(final ObjectPool pool) { return erodingPool(pool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param <T> the type of object * @param pool the ObjectPool to be decorated so it shrinks it's idle count when possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(ObjectPool, float) * @since Pool 1.4 */ public static <T> ObjectPool<T> erodingPool(final ObjectPool<T> pool) { return erodingPool(pool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param <K> the type of key * @param <V> the type of object * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float) * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static <K, V> KeyedObjectPool<K, V> erodingPool(final KeyedObjectPool<K, V> keyedPool) { return erodingPool(keyedPool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float) * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static KeyedObjectPool erodingPool(final KeyedObjectPool keyedPool) { return erodingPool(keyedPool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * @param <K> the type of key * @param <V> the type of object * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float) * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static <K, V> KeyedObjectPool<K, V> erodingPool(final KeyedObjectPool<K, V> keyedPool) { return erodingPool(keyedPool, 1f); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * <p> * The factor parameter provides a mechanism to tweak the rate at which the pool tries to shrink * it's size. Values between 0 and 1 cause the pool to try to shrink it's size more often. * Values greater than 1 cause the pool to less frequently try to shrink it's size. * </p> * * @param <K> the type of key * @param <V> the type of object * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @param factor a positive value to scale the rate at which the pool tries to reduce it's size. * If 0 < factor < 1 then the pool shrinks more aggressively. * If 1 < factor then the pool shrinks less aggressively. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static <K, V> KeyedObjectPool<K, V> erodingPool(final KeyedObjectPool<K, V> keyedPool, final float factor) { return erodingPool(keyedPool, factor, false); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * <p> * The factor parameter provides a mechanism to tweak the rate at which the pool tries to shrink * it's size. Values between 0 and 1 cause the pool to try to shrink it's size more often. * Values greater than 1 cause the pool to less frequently try to shrink it's size. * </p> * * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @param factor a positive value to scale the rate at which the pool tries to reduce it's size. * If 0 < factor < 1 then the pool shrinks more aggressively. * If 1 < factor then the pool shrinks less aggressively. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static KeyedObjectPool erodingPool(final KeyedObjectPool keyedPool, final float factor) { return erodingPool(keyedPool, factor, false); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * <p> * The factor parameter provides a mechanism to tweak the rate at which the pool tries to shrink * it's size. Values between 0 and 1 cause the pool to try to shrink it's size more often. * Values greater than 1 cause the pool to less frequently try to shrink it's size. * </p> * * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @param factor a positive value to scale the rate at which the pool tries to reduce it's size. * If 0 < factor < 1 then the pool shrinks more aggressively. * If 1 < factor then the pool shrinks less aggressively. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static KeyedObjectPool erodingPool(final KeyedObjectPool keyedPool, final float factor) { return erodingPool(keyedPool, factor, false); }
/** * Returns a pool that adaptively decreases it's size when idle objects are no longer needed. * This is intended as an always thread-safe alternative to using an idle object evictor * provided by many pool implementations. This is also an effective way to shrink FIFO ordered * pools that experience load spikes. * * <p> * The factor parameter provides a mechanism to tweak the rate at which the pool tries to shrink * it's size. Values between 0 and 1 cause the pool to try to shrink it's size more often. * Values greater than 1 cause the pool to less frequently try to shrink it's size. * </p> * * @param <K> the type of key * @param <V> the type of object * @param keyedPool the KeyedObjectPool to be decorated so it shrinks it's idle count when * possible. * @param factor a positive value to scale the rate at which the pool tries to reduce it's size. * If 0 < factor < 1 then the pool shrinks more aggressively. * If 1 < factor then the pool shrinks less aggressively. * @return a pool that adaptively decreases it's size when idle objects are no longer needed. * @see #erodingPool(KeyedObjectPool, float, boolean) * @since Pool 1.4 */ public static <K, V> KeyedObjectPool<K, V> erodingPool(final KeyedObjectPool<K, V> keyedPool, final float factor) { return erodingPool(keyedPool, factor, false); }