List of usage examples for org.apache.commons.pool2.impl GenericObjectPoolConfig getTestOnCreate
public boolean getTestOnCreate()
From source file:io.lettuce.core.support.CommonsPool2ConfigConverter.java
/** * Converts {@link GenericObjectPoolConfig} properties to an immutable {@link BoundedPoolConfig}. Applies max total, min/max * idle and test on borrow/create/release configuration. * * @param config must not be {@literal null}. * @return the converted {@link BoundedPoolConfig}. *///w w w . ja va 2s . c o m public static BoundedPoolConfig bounded(GenericObjectPoolConfig config) { LettuceAssert.notNull(config, "GenericObjectPoolConfig must not be null"); return BoundedPoolConfig.builder().maxTotal(config.getMaxTotal()).maxIdle(config.getMaxIdle()) .minIdle(config.getMinIdle()).testOnAcquire(config.getTestOnBorrow()) .testOnCreate(config.getTestOnCreate()).testOnRelease(config.getTestOnReturn()).build(); }
From source file:JDBCPool.dbcp.demo.sourcecode.GenericObjectPool.java
/** * Sets the base pool configuration./* w w w .ja va 2 s . c o m*/ * * @param conf the new configuration to use. This is used by value. * * @see GenericObjectPoolConfig */ public void setConfig(GenericObjectPoolConfig conf) { setLifo(conf.getLifo()); setMaxIdle(conf.getMaxIdle()); setMinIdle(conf.getMinIdle()); setMaxTotal(conf.getMaxTotal()); setMaxWaitMillis(conf.getMaxWaitMillis()); setBlockWhenExhausted(conf.getBlockWhenExhausted()); setTestOnCreate(conf.getTestOnCreate()); setTestOnBorrow(conf.getTestOnBorrow()); setTestOnReturn(conf.getTestOnReturn()); setTestWhileIdle(conf.getTestWhileIdle()); setNumTestsPerEvictionRun(conf.getNumTestsPerEvictionRun()); setMinEvictableIdleTimeMillis(conf.getMinEvictableIdleTimeMillis()); setTimeBetweenEvictionRunsMillis(conf.getTimeBetweenEvictionRunsMillis()); setSoftMinEvictableIdleTimeMillis(conf.getSoftMinEvictableIdleTimeMillis()); setEvictionPolicyClassName(conf.getEvictionPolicyClassName()); }