Class GenericKeyedObjectPoolConfig<T>

  • Type Parameters:
    T - Type of element pooled.
    All Implemented Interfaces:
    java.lang.Cloneable

    public class GenericKeyedObjectPoolConfig<T>
    extends BaseObjectPoolConfig<T>
    A simple "struct" encapsulating the configuration for a GenericKeyedObjectPool.

    This class is not thread-safe; it is only intended to be used to provide attributes used when creating a pool.

    Since:
    2.0
    • Constructor Detail

      • GenericKeyedObjectPoolConfig

        public GenericKeyedObjectPoolConfig()
        Constructs a new configuration with default settings.
    • Method Detail

      • getMaxIdlePerKey

        public int getMaxIdlePerKey()
        Get the value for the maxIdlePerKey configuration attribute for pools created with this configuration instance.
        Returns:
        The current setting of maxIdlePerKey for this configuration instance
        See Also:
        GenericKeyedObjectPool.getMaxIdlePerKey()
      • getMaxTotal

        public int getMaxTotal()
        Get the value for the maxTotal configuration attribute for pools created with this configuration instance.
        Returns:
        The current setting of maxTotal for this configuration instance
        See Also:
        BaseGenericObjectPool.getMaxTotal()
      • getMaxTotalPerKey

        public int getMaxTotalPerKey()
        Get the value for the maxTotalPerKey configuration attribute for pools created with this configuration instance.
        Returns:
        The current setting of maxTotalPerKey for this configuration instance
        See Also:
        GenericKeyedObjectPool.getMaxTotalPerKey()
      • getMinIdlePerKey

        public int getMinIdlePerKey()
        Get the value for the minIdlePerKey configuration attribute for pools created with this configuration instance.
        Returns:
        The current setting of minIdlePerKey for this configuration instance
        See Also:
        GenericKeyedObjectPool.getMinIdlePerKey()
      • setMaxIdlePerKey

        public void setMaxIdlePerKey​(int maxIdlePerKey)
        Set the value for the maxIdlePerKey configuration attribute for pools created with this configuration instance.
        Parameters:
        maxIdlePerKey - The new setting of maxIdlePerKey for this configuration instance
        See Also:
        GenericKeyedObjectPool.setMaxIdlePerKey(int)
      • setMaxTotal

        public void setMaxTotal​(int maxTotal)
        Set the value for the maxTotal configuration attribute for pools created with this configuration instance.
        Parameters:
        maxTotal - The new setting of maxTotal for this configuration instance
        See Also:
        BaseGenericObjectPool.setMaxTotal(int)
      • setMaxTotalPerKey

        public void setMaxTotalPerKey​(int maxTotalPerKey)
        Set the value for the maxTotalPerKey configuration attribute for pools created with this configuration instance.
        Parameters:
        maxTotalPerKey - The new setting of maxTotalPerKey for this configuration instance
        See Also:
        GenericKeyedObjectPool.setMaxTotalPerKey(int)
      • setMinIdlePerKey

        public void setMinIdlePerKey​(int minIdlePerKey)
        Set the value for the minIdlePerKey configuration attribute for pools created with this configuration instance.
        Parameters:
        minIdlePerKey - The new setting of minIdlePerKey for this configuration instance
        See Also:
        GenericKeyedObjectPool.setMinIdlePerKey(int)
      • toStringAppendFields

        protected void toStringAppendFields​(java.lang.StringBuilder builder)
        Description copied from class: BaseObject
        Used by sub-classes to include the fields defined by the sub-class in the BaseObject.toString() output.
        Overrides:
        toStringAppendFields in class BaseObjectPoolConfig<T>
        Parameters:
        builder - Field names and values are appended to this object