/**
   * Create a new <code>GenericObjectPool</code> using a specific configuration.
   *
   * @param factory The object factory to be used to create object instances used by this pool
   * @param config The configuration to use for this pool instance. The configuration is used by
   *     value. Subsequent changes to the configuration object will not be reflected in the pool.
   */
  public GenericObjectPool(PooledObjectFactory<T> factory, GenericObjectPoolConfig config) {

    super(config, ONAME_BASE, config.getJmxNamePrefix());

    if (factory == null) {
      jmxUnregister(); // tidy up
      throw new IllegalArgumentException("factory may not be null");
    }
    this.factory = factory;

    idleObjects = new LinkedBlockingDeque<>(config.getFairness());

    setConfig(config);

    startEvictor(getTimeBetweenEvictionRunsMillis());
  }