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

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

Best Java code snippets using org.apache.commons.pool.impl.GenericObjectPool.setSoftMinEvictableIdleTimeMillis (Showing top 14 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.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
objectPool.setTestOnReturn(testOnReturn);
objectPool.setSoftMinEvictableIdleTimeMillis(softMinEvictableIdleTimeMillis);
objectPool.setLifo(lifo);
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: alexo/wro4j

/**
 * Creates a {@link GenericObjectPool}. Override this method to set custom objectPool configurations.
 */
protected GenericObjectPool<T> newObjectPool(final ObjectFactory<T> objectFactory) {
 final int maxActive = Math.max(2, Runtime.getRuntime().availableProcessors());
 final GenericObjectPool<T> pool = new GenericObjectPool<T>(new BasePoolableObjectFactory<T>() {
  @Override
  public T makeObject()
   throws Exception {
   return objectFactory.create();
  }
 });
 pool.setMaxActive(maxActive);
 pool.setMaxIdle(MAX_IDLE);
 pool.setMaxWait(MAX_WAIT);
 /**
  * Use WHEN_EXHAUSTED_GROW strategy, otherwise the pool object retrieval can fail. More details here:
  * <a>http://code.google.com/p/wro4j/issues/detail?id=364</a>
  */
 pool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_GROW);
 // make object eligible for eviction after a predefined amount of time.
 pool.setSoftMinEvictableIdleTimeMillis(EVICTABLE_IDLE_TIME);
 pool.setTimeBetweenEvictionRunsMillis(EVICTABLE_IDLE_TIME);
 return pool;
}
origin: ro.isdc.wro4j/wro4j-extensions

/**
 * Creates a {@link GenericObjectPool}. Override this method to set custom objectPool configurations.
 */
protected GenericObjectPool<T> newObjectPool(final ObjectFactory<T> objectFactory) {
 final int maxActive = Math.max(2, Runtime.getRuntime().availableProcessors());
 final GenericObjectPool<T> pool = new GenericObjectPool<T>(new BasePoolableObjectFactory<T>() {
  @Override
  public T makeObject()
   throws Exception {
   return objectFactory.create();
  }
 });
 pool.setMaxActive(maxActive);
 pool.setMaxIdle(MAX_IDLE);
 pool.setMaxWait(MAX_WAIT);
 /**
  * Use WHEN_EXHAUSTED_GROW strategy, otherwise the pool object retrieval can fail. More details here:
  * <a>http://code.google.com/p/wro4j/issues/detail?id=364</a>
  */
 pool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_GROW);
 // make object eligible for eviction after a predefined amount of time.
 pool.setSoftMinEvictableIdleTimeMillis(EVICTABLE_IDLE_TIME);
 pool.setTimeBetweenEvictionRunsMillis(EVICTABLE_IDLE_TIME);
 return pool;
}
origin: ontopia/ontopia

int etime = (_etime == null ? -1 : Integer.parseInt(_etime));
pool.setTimeBetweenEvictionRunsMillis(etime);
pool.setSoftMinEvictableIdleTimeMillis(etime);
origin: ontopia/ontopia

int etime = (_etime == null ? -1 : Integer.parseInt(_etime));
pool.setTimeBetweenEvictionRunsMillis(etime);
pool.setSoftMinEvictableIdleTimeMillis(etime);
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: 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: 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.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.eclipse.neoscada.utils/org.eclipse.scada.utils.osgi.jdbc.pool

this.connectionPool.setMinEvictableIdleTimeMillis ( getLong ( paramProperties, PREFIX + "minEvictableIdleTimeMillis", 30 * 60 * 1000 ) );
this.connectionPool.setTestWhileIdle ( getBoolean ( paramProperties, PREFIX + "testWhileIdle", false ) );
this.connectionPool.setSoftMinEvictableIdleTimeMillis ( getLong ( paramProperties, PREFIX + "softMinEvictableIdleTimeMillis", -1 ) );
this.connectionPool.setNumTestsPerEvictionRun ( getInteger ( paramProperties, PREFIX + "numTestsPerEvictionRun", 3 ) );
origin: de.dentrassi.eclipse.neoscada.utils/org.eclipse.scada.utils.osgi.jdbc.pool

this.connectionPool.setMinEvictableIdleTimeMillis ( getLong ( paramProperties, PREFIX + "minEvictableIdleTimeMillis", 30 * 60 * 1000 ) );
this.connectionPool.setTestWhileIdle ( getBoolean ( paramProperties, PREFIX + "testWhileIdle", false ) );
this.connectionPool.setSoftMinEvictableIdleTimeMillis ( getLong ( paramProperties, PREFIX + "softMinEvictableIdleTimeMillis", -1 ) );
this.connectionPool.setNumTestsPerEvictionRun ( getInteger ( paramProperties, PREFIX + "numTestsPerEvictionRun", 3 ) );
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.implGenericObjectPoolsetSoftMinEvictableIdleTimeMillis

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), with the extra condition that at least "minIdle" object instances remain in the pool. 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
  • 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
  • setTestOnBorrow,
  • setWhenExhaustedAction,
  • getNumActive,
  • getNumIdle,
  • setTestWhileIdle,
  • setNumTestsPerEvictionRun,
  • setTestOnReturn,
  • invalidateObject,
  • clear,
  • addObject

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Runner (org.openjdk.jmh.runner)
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