protected void createConnectionPool()

in src/main/java/org/apache/commons/dbcp2/BasicDataSource.java [481:504]


    protected void createConnectionPool(final PoolableConnectionFactory factory) {
        // Create an object pool to contain our active connections
        final GenericObjectPoolConfig<PoolableConnection> config = new GenericObjectPoolConfig<>();
        updateJmxName(config);
        // Disable JMX on the underlying pool if the DS is not registered:
        config.setJmxEnabled(registeredJmxObjectName != null);
        final GenericObjectPool<PoolableConnection> gop = createObjectPool(factory, config, abandonedConfig);
        gop.setMaxTotal(maxTotal);
        gop.setMaxIdle(maxIdle);
        gop.setMinIdle(minIdle);
        gop.setMaxWait(maxWaitDuration);
        gop.setTestOnCreate(testOnCreate);
        gop.setTestOnBorrow(testOnBorrow);
        gop.setTestOnReturn(testOnReturn);
        gop.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
        gop.setMinEvictableIdle(minEvictableIdleDuration);
        gop.setSoftMinEvictableIdle(softMinEvictableIdleDuration);
        gop.setTestWhileIdle(testWhileIdle);
        gop.setLifo(lifo);
        gop.setSwallowedExceptionListener(new SwallowedExceptionLogger(log, logExpiredConnections));
        gop.setEvictionPolicyClassName(evictionPolicyClassName);
        factory.setPool(gop);
        connectionPool = gop;
    }