Interface IPool.Controller<K>

Enclosing interface:
IPool<K,V>

public static interface IPool.Controller<K>
  • Method Details

    • shouldIncrement

      boolean shouldIncrement(K key, int objectsForKey, int totalObjects)
      Parameters:
      key - the key which requires a new object
      objectsForKey - the number of currently existing objects for 'key'
      totalObjects - the total number of objects across every key
      Returns:
      'true' if a new object under 'key' should be created, false otherwise
    • adjustment

      Map<K,Integer> adjustment(Map<K,Stats> stats)
      Parameters:
      stats - a map of key onto stats for that key
      Returns:
      a map of key onto how many objects should be created (if positive) or disposed (if negative)