/** * 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); }
/** * Allows an ExhaustedAction to be configured on the requester object pool See: * {@link GenericKeyedObjectPool#setWhenExhaustedAction(byte)} */ public void setRequesterPoolWhenExhaustedAction(byte whenExhaustedAction) { requesters.setWhenExhaustedAction(whenExhaustedAction); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setWhenExhaustedAction(byte) */ public void setWhenExhaustedAction(byte whenExhaustedAction) { this.keyedObjectPool.setWhenExhaustedAction(whenExhaustedAction); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setWhenExhaustedAction(byte) */ public void setWhenExhaustedAction(byte whenExhaustedAction) { this.keyedObjectPool.setWhenExhaustedAction(whenExhaustedAction); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setWhenExhaustedAction(byte) */ public void setWhenExhaustedAction(byte whenExhaustedAction) { this.keyedObjectPool.setWhenExhaustedAction(whenExhaustedAction); }
/** * @see org.apache.commons.pool.impl.GenericKeyedObjectPool#setWhenExhaustedAction(byte) */ public void setWhenExhaustedAction(byte whenExhaustedAction) { this.keyedObjectPool.setWhenExhaustedAction(whenExhaustedAction); }
/** * Allows an ExhaustedAction to be configured on the requester object pool See: * {@link GenericKeyedObjectPool#setWhenExhaustedAction(byte)} */ public void setRequesterPoolWhenExhaustedAction(byte whenExhaustedAction) { requesters.setWhenExhaustedAction(whenExhaustedAction); }
public void setWhenExhaustedAction(byte whenExhaustedAction) { pool.setWhenExhaustedAction(whenExhaustedAction); }
public void setWhenExhaustedAction(byte whenExhaustedAction) { pool.setWhenExhaustedAction(whenExhaustedAction); }
public GenericKeyedObjectPool getClientPool(KeyedPoolableObjectFactory factory, int maxActive, int maxIdle, boolean testOnBorrow, long timeBetweenEvictionRunsMillis, long minEvictableIdleTimeMillis) { if (socketPool == null) { synchronized (ClientPool.class) { if (socketPool == null) { socketPool = new GenericKeyedObjectPoolImpl(); socketPool.setFactory(factory); socketPool.setMaxActive(maxActive); socketPool.setTestOnBorrow(testOnBorrow); socketPool.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); socketPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); socketPool.setMaxIdle(maxIdle); socketPool.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_BLOCK); } } } return socketPool; }
public GenericKeyedObjectPool getClientPool(KeyedPoolableObjectFactory factory, int maxActive, int maxIdle, boolean testOnBorrow, long timeBetweenEvictionRunsMillis, long minEvictableIdleTimeMillis) { if (socketPool == null) { synchronized (ClientPool.class) { if (socketPool == null) { socketPool = new GenericKeyedObjectPoolImpl(); socketPool.setFactory(factory); socketPool.setMaxActive(maxActive); socketPool.setTestOnBorrow(testOnBorrow); socketPool.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); socketPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); socketPool.setMaxIdle(maxIdle); socketPool.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_GROW); } } } return socketPool; }
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 GenericKeyedObjectPool getClientPool(AbstractClientPoolFactory factory, int maxActive, int maxIdle, boolean testOnBorrow, long timeBetweenEvictionRunsMillis, long minEvictableIdleTimeMillis) { if (socketPool == null) { synchronized (this) { if (socketPool == null) { socketPool = new GenericKeyedObjectPool(); socketPool.setFactory(factory); socketPool.setMaxActive(maxActive); socketPool.setTestOnBorrow(testOnBorrow); socketPool.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); socketPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); socketPool.setMaxIdle(maxIdle); socketPool.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_GROW); } } } return socketPool; }
public GenericKeyedObjectPool getClientPool(AbstractClientPoolFactory factory, int maxActive, int maxIdle, boolean testOnBorrow, long timeBetweenEvictionRunsMillis, long minEvictableIdleTimeMillis) { if (socketPool == null) { synchronized (this) { if (socketPool == null) { socketPool = new GenericKeyedObjectPool(); socketPool.setFactory(factory); socketPool.setMaxActive(maxActive); socketPool.setTestOnBorrow(testOnBorrow); socketPool.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); socketPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); socketPool.setMaxIdle(maxIdle); socketPool.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_GROW); } } } return socketPool; }
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); }
private void registerPool( String username, String password) throws javax.naming.NamingException, SQLException { ConnectionPoolDataSource cpds = testCPDS(username, password); // Create an object pool to contain our PooledConnections GenericKeyedObjectPool tmpPool = new GenericKeyedObjectPool(null); tmpPool.setMaxActive(getMaxActive()); tmpPool.setMaxIdle(getMaxIdle()); tmpPool.setMaxWait(getMaxWait()); tmpPool.setWhenExhaustedAction(whenExhaustedAction(maxActive, maxWait)); tmpPool.setTestOnBorrow(getTestOnBorrow()); tmpPool.setTestOnReturn(getTestOnReturn()); tmpPool.setTimeBetweenEvictionRunsMillis( getTimeBetweenEvictionRunsMillis()); tmpPool.setNumTestsPerEvictionRun(getNumTestsPerEvictionRun()); tmpPool.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis()); tmpPool.setTestWhileIdle(getTestWhileIdle()); pool = tmpPool; // Set up the factory we will use (passing the pool associates // the factory with the pool, so we do not have to do so // explicitly) factory = new KeyedCPDSConnectionFactory(cpds, pool, getValidationQuery(), isRollbackAfterValidation()); }