/** * Sets the configuration. * @param conf the new configuration to use. * @see GenericKeyedObjectPool.Config */ public synchronized void setConfig(GenericKeyedObjectPool.Config conf) { setMaxIdle(conf.maxIdle); setMaxActive(conf.maxActive); setMaxTotal(conf.maxTotal); setMinIdle(conf.minIdle); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setMaxTotal(int) */ public void setMaxTotal(int maxTotal) { this.keyedObjectPool.setMaxTotal(maxTotal); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setMaxTotal(int) */ public void setMaxTotal(int maxTotal) { this.keyedObjectPool.setMaxTotal(maxTotal); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setMaxTotal(int) */ public void setMaxTotal(int maxTotal) { this.keyedObjectPool.setMaxTotal(maxTotal); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setMaxTotal(int) */ public void setMaxTotal(int maxTotal) { this.keyedObjectPool.setMaxTotal(maxTotal); }
public void setMaxTotal(int maxTotal) { pool.setMaxTotal(maxTotal); }
public void setMaxTotal(int maxTotal) { pool.setMaxTotal(maxTotal); }
/** * Configures the maximum number of requesters that can be concurrently active per endpoint * * @param maxActive max. number of active requesters */ public void setMaxRequestersActive(int maxActive) { this.requesters.setMaxActive(maxActive); // adjust maxIdle in tandem to avoid thrashing this.requesters.setMaxIdle(maxActive); // this tells the pool to expire some objects eventually if we start // running out. This happens if one is using a lot of dynamic endpoints. this.requesters.setMaxTotal(20 * maxActive); }
/** * Configures the maximum number of requesters that can be concurrently active * per endpoint * * @param maxActive max. number of active requesters */ public void setMaxRequestersActive(int maxActive) { this.requesters.setMaxActive(maxActive); // adjust maxIdle in tandem to avoid thrashing this.requesters.setMaxIdle(maxActive); // this tells the pool to expire some objects eventually if we start // running out. This happens if one is using a lot of dynamic endpoints. this.requesters.setMaxTotal(20 * maxActive); }
public GroovyPool(String scriptBaseClass) { super(); Configuration conf = Configuration.getInstance(); try { pool = new GenericKeyedObjectPool<>(new GroovyPoolFactory(scriptBaseClass)); pool.setTestOnBorrow(true); pool.setMaxTotal(conf.getPropertyAsInteger("tec.expressions.pool.maxtotal",1000)); pool.setMaxActive(-1); pool.setMaxIdle(conf.getPropertyAsInteger("tec.expressions.pool.maxidle",-1)); pool.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_BLOCK); pool.setTimeBetweenEvictionRunsMillis(30000); pool.setMinEvictableIdleTimeMillis(-1); } catch(Exception e) { logger.error("An error occurred while starting GroovyPool.", e); } }
public synchronized static void initializeConnectionPool(EventSyncConnectionPoolFactory factory, int maxActive, int maxTotal, int maxIdle, long maxWait, long minEvictableIdleTimeMillis) { if (connectionPool == null) { connectionPool = new GenericKeyedObjectPool(); connectionPool.setFactory(factory); connectionPool.setMaxTotal(maxTotal); connectionPool.setMaxActive(maxActive); connectionPool.setTestOnBorrow(true); connectionPool.setTimeBetweenEvictionRunsMillis(12000); connectionPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); connectionPool.setMaxIdle(maxIdle); connectionPool.setMaxWait(maxWait); connectionPool.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_BLOCK); } }
/** * Sets the configuration. * @param conf the new configuration to use. * @see GenericKeyedObjectPool.Config */ public synchronized void setConfig(GenericKeyedObjectPool.Config conf) { setMaxIdle(conf.maxIdle); setMaxActive(conf.maxActive); setMaxTotal(conf.maxTotal); setMinIdle(conf.minIdle); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); }
/** * Sets the configuration. * @param conf the new configuration to use. * @see GenericKeyedObjectPool.Config */ public synchronized void setConfig(GenericKeyedObjectPool.Config conf) { setMaxIdle(conf.maxIdle); setMaxActive(conf.maxActive); setMaxTotal(conf.maxTotal); setMinIdle(conf.minIdle); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); }
/** * Sets the configuration. * @param conf the new configuration to use. * @see GenericKeyedObjectPool.Config */ public synchronized void setConfig(GenericKeyedObjectPool.Config conf) { setMaxIdle(conf.maxIdle); setMaxActive(conf.maxActive); setMaxTotal(conf.maxTotal); setMinIdle(conf.minIdle); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); }
/** * Sets the configuration. * @param conf the new configuration to use. * @see GenericKeyedObjectPool.Config */ public synchronized void setConfig(GenericKeyedObjectPool.Config conf) { setMaxIdle(conf.maxIdle); setMaxActive(conf.maxActive); setMaxTotal(conf.maxTotal); setMinIdle(conf.minIdle); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); }