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

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

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

  • 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.setTestOnBorrow(testOnBorrow);
objectPool.setTestWhileIdle(testWhileIdle);
objectPool.setMinEvictableIdleTimeMillis(evictionTimeMillis);
objectPool.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRuns);
objectPool.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
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.apache.commons/com.springsource.org.apache.commons.dbcp

/**
 * Sets the {@link #minEvictableIdleTimeMillis} property.
 * 
 * @param minEvictableIdleTimeMillis the minimum amount of time an object
 * may sit idle in the pool 
 * @see #minEvictableIdleTimeMillis
 */
public synchronized void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
  this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
  if (connectionPool != null) {
    connectionPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
  }
}
origin: org.onehippo.cms7.hst.components/hst-session-pool

/**
 * Sets the {@link #minEvictableIdleTimeMillis} property.
 * 
 * @param minEvictableIdleTimeMillis the minimum amount of time an object
 * may sit idle in the pool 
 * @see #minEvictableIdleTimeMillis
 */
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
  this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
  if (sessionPool != null) {
    sessionPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
  }
}
origin: org.apache.openjpa/openjpa-all

/**
 * Sets the {@link #minEvictableIdleTimeMillis} property.
 * 
 * @param minEvictableIdleTimeMillis the minimum amount of time an object
 * may sit idle in the pool 
 * @see #minEvictableIdleTimeMillis
 */
public synchronized void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
  this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
  if (connectionPool != null) {
    connectionPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
  }
}
origin: org.everit.osgi.bundles/org.everit.osgi.bundles.commons-dbcp

/**
 * Sets the {@link #minEvictableIdleTimeMillis} property.
 * 
 * @param minEvictableIdleTimeMillis the minimum amount of time an object
 * may sit idle in the pool 
 * @see #minEvictableIdleTimeMillis
 */
public synchronized void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
  this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
  if (connectionPool != null) {
    connectionPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
  }
}
origin: uk.org.mygrid.resources/boca-model

public void setQueryConnectionPoolMinIdleTime(long minWait) {
  queryPool.setMinEvictableIdleTimeMillis(minWait);
}
origin: org.idevlab/rjc

/**
 * Sets the {@link #minEvictableIdleTimeMillis} property.
 *
 * @param minEvictableIdleTimeMillis the minimum amount of time an object
 *                                   may sit idle in the pool
 * @see #minEvictableIdleTimeMillis
 */
public synchronized void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
  this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
  if (connectionPool != null) {
    connectionPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
  }
}
origin: uk.org.mygrid.resources/boca-model

public void setReadConnectionPoolMinIdleTime(long minWait) {
  roPool.setMinEvictableIdleTimeMillis(minWait);
}
origin: uk.org.mygrid.resources/boca-model

public void setWriteConnectionPoolMinIdleTime(long minWait) {
  rwPool.setMinEvictableIdleTimeMillis(minWait);
}
origin: stackoverflow.com

GenericObjectPool connectionPool = new GenericObjectPool(null);
 connectionPool.setMinEvictableIdleTimeMillis(1000 * 60 * 30);
 connectionPool.setTimeBetweenEvictionRunsMillis(1000 * 60 * 30);
 connectionPool.setNumTestsPerEvictionRun(3);
 connectionPool.setTestOnBorrow(true);
 connectionPool.setTestWhileIdle(false);
 connectionPool.setTestOnReturn(false);
 props = new Properties();
 props.put("user", username);
 props.put("password", password);
 ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, props);
 PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectionPool, null, "SELECT 1", false, true);
 PoolingDataSource dataSource = new PoolingDataSource(connectionPool);
origin: org.hobsoft.symmetry/symmetry-core

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);
}
 
origin: org.apache.tapestry/com.springsource.org.apache.tapestry

_contextPool.setMinEvictableIdleTimeMillis(POOL_MIN_IDLE_TIME);
_contextPool.setTimeBetweenEvictionRunsMillis(POOL_SLEEP_TIME);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool

/**
 * Sets my configuration.
 *
 * @param conf configuration to use.
 * @see GenericObjectPool.Config
 */
public synchronized void setConfig(GenericObjectPool.Config conf) {
  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.apache.openjpa/openjpa-all

/**
 * 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: apache/servicemix-bundles

/**
 * Subclasses can override this if they want to return a specific Commons pool.
 * They should apply any configuration properties to the pool here.
 * <p>Default is a GenericObjectPool instance with the given pool size.
 * @return an empty Commons {@code ObjectPool}.
 * @see org.apache.commons.pool.impl.GenericObjectPool
 * @see #setMaxSize
 */
protected ObjectPool createObjectPool() {
  GenericObjectPool gop = new GenericObjectPool(this);
  gop.setMaxActive(getMaxSize());
  gop.setMaxIdle(getMaxIdle());
  gop.setMinIdle(getMinIdle());
  gop.setMaxWait(getMaxWait());
  gop.setTimeBetweenEvictionRunsMillis(getTimeBetweenEvictionRunsMillis());
  gop.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis());
  gop.setWhenExhaustedAction(getWhenExhaustedAction());
  return gop;
}
origin: org.apache.commons/com.springsource.org.apache.commons.pool

/**
 * Sets my configuration.
 *
 * @param conf configuration to use.
 * @see GenericObjectPool.Config
 */
public synchronized void setConfig(GenericObjectPool.Config conf) {
  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: springframework/spring-aop

/**
 * Subclasses can override this if they want to return a specific Commons pool.
 * They should apply any configuration properties to the pool here.
 * <p>Default is a GenericObjectPool instance with the given pool size.
 * @return an empty Commons <code>ObjectPool</code>.
 * @see org.apache.commons.pool.impl.GenericObjectPool
 * @see #setMaxSize
 */
protected ObjectPool createObjectPool() {
  GenericObjectPool gop = new GenericObjectPool(this);
  gop.setMaxActive(getMaxSize());
  gop.setMaxIdle(getMaxIdle());
  gop.setMinIdle(getMinIdle());
  gop.setMaxWait(getMaxWait());
  gop.setTimeBetweenEvictionRunsMillis(getTimeBetweenEvictionRunsMillis());
  gop.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis());
  gop.setWhenExhaustedAction(getWhenExhaustedAction());
  return gop;
}
origin: org.graylog2/syslog4j

protected void configureGenericObjectPool(GenericObjectPool genericObjectPool) throws SyslogRuntimeException {
  SyslogPoolConfigIF poolConfig = null;
  try {
    poolConfig = (SyslogPoolConfigIF) this.syslog.getConfig();
  } catch (ClassCastException cce) {
    throw new SyslogRuntimeException("config must implement interface SyslogPoolConfigIF");
  }
  genericObjectPool.setMaxActive(poolConfig.getMaxActive());
  genericObjectPool.setMaxIdle(poolConfig.getMaxIdle());
  genericObjectPool.setMaxWait(poolConfig.getMaxWait());
  genericObjectPool.setMinEvictableIdleTimeMillis(poolConfig.getMinEvictableIdleTimeMillis());
  genericObjectPool.setMinIdle(poolConfig.getMinIdle());
  genericObjectPool.setNumTestsPerEvictionRun(poolConfig.getNumTestsPerEvictionRun());
  genericObjectPool.setSoftMinEvictableIdleTimeMillis(poolConfig.getSoftMinEvictableIdleTimeMillis());
  genericObjectPool.setTestOnBorrow(poolConfig.isTestOnBorrow());
  genericObjectPool.setTestOnReturn(poolConfig.isTestOnReturn());
  genericObjectPool.setTestWhileIdle(poolConfig.isTestWhileIdle());
  genericObjectPool.setTimeBetweenEvictionRunsMillis(poolConfig.getTimeBetweenEvictionRunsMillis());
  genericObjectPool.setWhenExhaustedAction(poolConfig.getWhenExhaustedAction());
}
origin: com.nesscomputing/ness-syslog4j

protected void configureGenericObjectPool(GenericObjectPool<AbstractSyslogWriter> genericObjectPool) throws SyslogRuntimeException {
  SyslogPoolConfigIF poolConfig = null;
  try {
    poolConfig = (SyslogPoolConfigIF) this.syslog.getConfig();
  } catch (ClassCastException cce) {
    throw new SyslogRuntimeException("config must implement interface SyslogPoolConfigIF");
  }
  genericObjectPool.setMaxActive(poolConfig.getMaxActive());
  genericObjectPool.setMaxIdle(poolConfig.getMaxIdle());
  genericObjectPool.setMaxWait(poolConfig.getMaxWait());
  genericObjectPool.setMinEvictableIdleTimeMillis(poolConfig.getMinEvictableIdleTimeMillis());
  genericObjectPool.setMinIdle(poolConfig.getMinIdle());
  genericObjectPool.setNumTestsPerEvictionRun(poolConfig.getNumTestsPerEvictionRun());
  genericObjectPool.setSoftMinEvictableIdleTimeMillis(poolConfig.getSoftMinEvictableIdleTimeMillis());
  genericObjectPool.setTestOnBorrow(poolConfig.isTestOnBorrow());
  genericObjectPool.setTestOnReturn(poolConfig.isTestOnReturn());
  genericObjectPool.setTestWhileIdle(poolConfig.isTestWhileIdle());
  genericObjectPool.setTimeBetweenEvictionRunsMillis(poolConfig.getTimeBetweenEvictionRunsMillis());
  genericObjectPool.setWhenExhaustedAction(poolConfig.getWhenExhaustedAction());
}
org.apache.commons.pool.implGenericObjectPoolsetMinEvictableIdleTimeMillis

Javadoc

Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any). When non-positive, no objects will be evicted from the pool due to idle time alone.

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 #
  • setMaxIdle
    Sets the cap on the number of "idle" instances in the pool. If maxIdle is set too low on heavily loa
  • 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
  • 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

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • notifyDataSetChanged (ArrayAdapter)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
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