Class PoolUtils.KeyedObjectPoolMinIdleTimerTask<K,​V>

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

    private static class PoolUtils.KeyedObjectPoolMinIdleTimerTask<K,​V>
    extends java.util.TimerTask
    Timer task that adds objects to the pool until the number of idle instances for the given key 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 K key
      Key to ensure minIdle for
      private KeyedObjectPool<K,​V> keyedPool
      Keyed object pool
      private int minIdle
      Minimum number of idle instances.
    • 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().
      • key

        private final K key
        Key to ensure minIdle for
    • Constructor Detail

      • KeyedObjectPoolMinIdleTimerTask

        KeyedObjectPoolMinIdleTimerTask​(KeyedObjectPool<K,​V> keyedPool,
                                        K key,
                                        int minIdle)
                                 throws java.lang.IllegalArgumentException
        Create a new KeyedObjecPoolMinIdleTimerTask.
        Parameters:
        keyedPool - keyed object pool
        key - key to ensure minimum number of idle instances
        minIdle - minimum number of idle instances
        Throws:
        java.lang.IllegalArgumentException - if the key 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