Tabnine Logo
GenericObjectPool.setMinEvictableIdleTimeMillis
Code IndexAdd Tabnine 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)

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

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Table (org.hibernate.mapping)
    A relational table
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now