connectionPool.setMaxActive(maxActive);
objectPool.setMaxActive(maxPoolSize); objectPool.setMaxWait(connectionTimeout); objectPool.setMaxIdle(connectionMaxIlde);
public void setMaxPoolSize(int maxPoolSize) { pool.setMaxActive(maxPoolSize); }
/** * Sets my configuration. * * @param conf configuration to use. * @see GenericObjectPool.Config */ public void setConfig(GenericObjectPool.Config conf) { synchronized (this) { setMaxIdle(conf.maxIdle); setMinIdle(conf.minIdle); setMaxActive(conf.maxActive); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); setSoftMinEvictableIdleTimeMillis(conf.softMinEvictableIdleTimeMillis); setLifo(conf.lifo); } allocate(); }
/** * Sets the the current maximum number of active transformer objects allowed in the * pool * * @param maxActiveTransformers New maximum size to set */ public void setMaxActiveTransformers(int maxActiveTransformers) { transformerPool.setMaxActive(maxActiveTransformers); }
/** * Sets the the current maximum number of active transformer objects allowed in the * pool * * @param maxActiveTransformers New maximum size to set */ public void setMaxActiveTransformers(int maxActiveTransformers) { transformerPool.setMaxActive(maxActiveTransformers); }
/** * Sets the maximum number of active connections that can be * allocated at the same time. Use a negative value for no limit. * * @param maxActive the new value for maxActive * @see #getMaxActive() */ public synchronized void setMaxActive(int maxActive) { this.maxActive = maxActive; if (connectionPool != null) { connectionPool.setMaxActive(maxActive); } }
/** * Sets the maximum number of active connections that can be * allocated at the same time. * * @param maxActive the new value for maxActive * @see #getMaxActive() */ public synchronized void setMaxActive(int maxActive) { this.maxActive = maxActive; if (connectionPool != null) { connectionPool.setMaxActive(maxActive); } }
/** * Sets the maximum number of active connections that can be * allocated at the same time. Use a negative value for no limit. * * @param maxActive the new value for maxActive * @see #getMaxActive() */ public synchronized void setMaxActive(int maxActive) { this.maxActive = maxActive; if (connectionPool != null) { connectionPool.setMaxActive(maxActive); } }
private void setMaxActive(int maxActive) { _socketPool.setMaxActive(maxActive); }
private void setMaxActive(int maxActive) { _socketPool.setMaxActive(maxActive); }
public void setWriteConnectionMaxPoolSize(int size) { rwPool.setMaxActive(size); }
private void setMaxActive(int maxActive) { _socketPool.setMaxActive(maxActive); }
/** * Sets the maximum number of active connections that can be * allocated at the same time. Use a negative value for no limit. * * @param maxActive the new value for maxActive * @see #getMaxActive() */ public synchronized void setMaxActive(int maxActive) { this.maxActive = maxActive; if (connectionPool != null) { connectionPool.setMaxActive(maxActive); } }
public XsltTransformer() { super(); transformerPool = new GenericObjectPool(new PooledXsltTransformerFactory()); transformerPool.setMinIdle(MIN_IDLE_TRANSFORMERS); transformerPool.setMaxIdle(MAX_IDLE_TRANSFORMERS); transformerPool.setMaxActive(MAX_ACTIVE_TRANSFORMERS); contextProperties = new HashMap<String, Object>(); }
private void setupPool(GenericObjectPool pool, RepositoryConnectionFactory factory, int maxActive, int maxIdle, long blockWait) { pool.setFactory(factory); pool.setMaxActive(maxActive); pool.setMaxIdle(maxIdle); pool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_BLOCK); pool.setMaxWait(blockWait); }
/** * Creates a connection pool that can be used for one or more * {@link PooledServiceSession} objects. * * @param maxConnections * @return */ public static GenericObjectPool<Integer> createConnectionPool(int maxConnections) { GenericObjectPool<Integer> connectionPool = new GenericObjectPool<Integer>(new ConnectionPoolObjectFactory()); connectionPool.setMaxActive(maxConnections); connectionPool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_BLOCK); return connectionPool; }
/** * Creates a connection pool that can be used for one or more * {@link PooledServiceSession} objects. * * @param maxConnections * @return */ public static GenericObjectPool<Integer> createConnectionPool(final int maxConnections) { final GenericObjectPool<Integer> connectionPool = new GenericObjectPool<>(new ConnectionPoolObjectFactory()); connectionPool.setMaxActive(maxConnections); connectionPool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_BLOCK); return connectionPool; }
private GenericObjectPool<XPathExpression> getXPathExpressionPool(String expression) { GenericObjectPool genericPool = new GenericObjectPool(new XPathExpressionFactory(xpathFactory, expression, namespaceContext, this)); genericPool.setMaxActive(MAX_ACTIVE_XPATH_EXPRESSIONS); genericPool.setMaxIdle(MAX_IDLE_XPATH_EXPRESSIONS); genericPool.setMinIdle(MIN_IDLE_XPATH_EXPRESSIONS); return genericPool; }
public DefaultComponentPool(PoolableObjectFactory objectFactory) { pool = new GenericObjectPool(objectFactory); pool.setMinIdle(POOL_SIZE); pool.setMaxActive(POOL_SIZE); pool.setNumTestsPerEvictionRun(0); pool.setMinEvictableIdleTimeMillis(0); pool.setTimeBetweenEvictionRunsMillis(POOL_SPAWN_DELAY); }