Class PoolUtils.ObjectPoolMinIdleTimerTask<T>

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    PoolUtils

    private static class PoolUtils.ObjectPoolMinIdleTimerTask<T>
    extends java.util.TimerTask
    Timer task that adds objects to the pool until the number of idle instances reaches the configured minIdle. Note that this is not the same as the pool's minIdle setting.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int minIdle
      Minimum number of idle instances.
      private ObjectPool<T> pool
      Object pool
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectPoolMinIdleTimerTask​(ObjectPool<T> pool, int minIdle)
      Create a new ObjectPoolMinIdleTimerTask for the given pool with the given minIdle setting.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      java.lang.String toString()
      • Methods inherited from class java.util.TimerTask

        cancel, scheduledExecutionTime
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • minIdle

        private final int minIdle
        Minimum number of idle instances. Not the same as pool.getMinIdle().
    • Constructor Detail

      • ObjectPoolMinIdleTimerTask

        ObjectPoolMinIdleTimerTask​(ObjectPool<T> pool,
                                   int minIdle)
                            throws java.lang.IllegalArgumentException
        Create a new ObjectPoolMinIdleTimerTask for the given pool with the given minIdle setting.
        Parameters:
        pool - object pool
        minIdle - number of idle instances to maintain
        Throws:
        java.lang.IllegalArgumentException - if the pool is null
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Specified by:
        run in class java.util.TimerTask
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object