Codota Logo
GenericObjectPool.setMaxIdle
Code IndexAdd Codota to your IDE (free)

How to use
setMaxIdle
method
in
org.apache.commons.pool.impl.GenericObjectPool

Best Java code snippets using org.apache.commons.pool.impl.GenericObjectPool.setMaxIdle (Showing top 20 results out of 324)

  • Common ways to obtain GenericObjectPool
private void myMethod () {
GenericObjectPool g =
  • Codota Iconnew GenericObjectPool()
  • Codota Iconnew GenericObjectPool(null)
  • Codota IconPoolableObjectFactory factory;new GenericObjectPool(factory)
  • Smart code suggestions by Codota
}
origin: apache/hive

objectPool.setMaxActive(maxPoolSize);
objectPool.setMaxWait(connectionTimeout);
objectPool.setMaxIdle(connectionMaxIlde);
objectPool.setMinIdle(connectionMinIlde);
objectPool.setTestOnBorrow(testOnBorrow);
origin: commons-pool/commons-pool

/**
 * 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();
}
origin: org.mule.modules/mule-module-xml

/**
 * Sets the the current maximum number of idle transformer objects allowed in the pool
 *
 * @param maxIdleTransformers New maximum size to set
 */
public void setMaxIdleTransformers(int maxIdleTransformers)
{
  transformerPool.setMaxIdle(maxIdleTransformers);
}
origin: org.mule.modules/mule-module-xml

/**
 * Sets the the current maximum number of idle transformer objects allowed in the pool
 *
 * @param maxIdleTransformers New maximum size to set
 */
public void setMaxIdleTransformers(int maxIdleTransformers)
{
  transformerPool.setMaxIdle(maxIdleTransformers);
}
origin: org.apache.openjpa/openjpa-all

private void setMaxIdle(int maxIdle) {
  _socketPool.setMaxIdle(maxIdle);
}
origin: org.everit.osgi.bundles/org.everit.osgi.bundles.commons-dbcp

/**
 * Sets the maximum number of connections that can remain idle in the
 * pool.
 * 
 * @see #getMaxIdle()
 * @param maxIdle the new value for maxIdle
 */
public synchronized void setMaxIdle(int maxIdle) {
  this.maxIdle = maxIdle;
  if (connectionPool != null) {
    connectionPool.setMaxIdle(maxIdle);
  }
}
origin: org.onehippo.cms7.hst.components/hst-session-pool

/**
 * Sets the maximum number of connections that can remain idle in the
 * pool.
 * 
 * @see #getMaxIdle()
 * @param maxIdle the new value for maxIdle
 */
public void setMaxIdle(int maxIdle) {
  this.maxIdle = maxIdle;
  if (sessionPool != null) {
    sessionPool.setMaxIdle(maxIdle);
  }
}
origin: org.idevlab/rjc

/**
 * Sets the maximum number of connections that can remain idle in the
 * pool.
 *
 * @param maxIdle the new value for maxIdle
 * @see #getMaxIdle()
 */
public synchronized void setMaxIdle(int maxIdle) {
  this.maxIdle = maxIdle;
  if (connectionPool != null) {
    connectionPool.setMaxIdle(maxIdle);
  }
}
origin: org.apache.openjpa/com.springsource.org.apache.openjpa

private void setMaxIdle(int maxIdle) {
  _socketPool.setMaxIdle(maxIdle);
}
origin: org.apache.openjpa/openjpa-kernel

private void setMaxIdle(int maxIdle) {
  _socketPool.setMaxIdle(maxIdle);
}
origin: org.apache.openjpa/openjpa-all

/**
 * Sets the maximum number of connections that can remain idle in the
 * pool.
 * 
 * @see #getMaxIdle()
 * @param maxIdle the new value for maxIdle
 */
public synchronized void setMaxIdle(int maxIdle) {
  this.maxIdle = maxIdle;
  if (connectionPool != null) {
    connectionPool.setMaxIdle(maxIdle);
  }
}
origin: org.apache.commons/com.springsource.org.apache.commons.dbcp

/**
 * Sets the maximum number of connections that can remail idle in the
 * pool.
 * 
 * @see #getMaxIdle()
 * @param maxIdle the new value for maxIdle
 */
public synchronized void setMaxIdle(int maxIdle) {
  this.maxIdle = maxIdle;
  if (connectionPool != null) {
    connectionPool.setMaxIdle(maxIdle);
  }
}
origin: uk.org.mygrid.resources/boca-model

public void setReadConnectionPoolMaxIdle(int max) {
  roPool.setMaxIdle(max);
}
origin: org.apache.openejb.patch/openjpa

private void setMaxIdle(int maxIdle) {
  _socketPool.setMaxIdle(maxIdle);
}
origin: org.apache.openejb.patch/openjpa-kernel

private void setMaxIdle(int maxIdle) {
  _socketPool.setMaxIdle(maxIdle);
}
origin: uk.org.mygrid.resources/boca-model

public void setWriteConnectionPoolMaxIdle(int max) {
  rwPool.setMaxIdle(max);
}
origin: uk.org.mygrid.resources/boca-model

public void setQueryConnectionPoolMaxIdle(int max) {
  queryPool.setMaxIdle(max);
}
origin: org.mule.modules/mule-module-xml

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>();
}
origin: uk.org.mygrid.resources/boca-model

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);
}
origin: org.mule.modules/mule-module-xml

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;
}
org.apache.commons.pool.implGenericObjectPoolsetMaxIdle

Javadoc

Sets the cap on the number of "idle" instances in the pool. If maxIdle is set too low on heavily loaded systems it is possible you will see objects being destroyed and almost immediately new objects being created. This is a result of the active threads momentarily returning objects faster than they are requesting them them, causing the number of idle objects to rise above maxIdle. The best value for maxIdle for heavily loaded system will vary but the default is a good starting point.

Popular methods of GenericObjectPool

  • <init>
    Create a new GenericObjectPool using the specified values.
  • returnObject
    Returns an object instance to the pool. If #getMaxIdle() is set to a positive value and the number
  • borrowObject
    Borrows an object from the pool. If there is an idle instance available in the pool, then either th
  • setMaxActive
    Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or
  • close
    Closes the pool. Once the pool is closed, #borrowObject()will fail with IllegalStateException, but #
  • setMinIdle
    Sets the minimum number of objects allowed in the pool before the evictor thread (if active) spawns
  • setTimeBetweenEvictionRunsMillis
    Sets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-po
  • setMinEvictableIdleTimeMillis
    Sets the minimum amount of time an object may sit idle in the pool before it is eligible for evictio
  • setMaxWait
    Sets the maximum amount of time (in milliseconds) the #borrowObject method should block before throw
  • setTestOnBorrow
    When true, objects will be PoolableObjectFactory#validateObjectbefore being returned by the #borrowO
  • setWhenExhaustedAction
    Sets the action to take when the #borrowObject method is invoked when the pool is exhausted (the max
  • getNumActive
    Return the number of instances currently borrowed from this pool.
  • setWhenExhaustedAction,
  • getNumActive,
  • getNumIdle,
  • setTestWhileIdle,
  • setNumTestsPerEvictionRun,
  • setTestOnReturn,
  • invalidateObject,
  • clear,
  • addObject

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now