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

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

Best Java code snippets using org.apache.commons.pool.impl.GenericObjectPool.getMaxActive (Showing top 18 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: commons-pool/commons-pool

/**
 * This returns the number of objects to create during the pool
 * sustain cycle. This will ensure that the minimum number of idle
 * instances is maintained without going past the maxActive value.
 *
 * @param incrementInternal - Should the count of objects currently under
 *                            some form of internal processing be
 *                            incremented?
 * @return The number of objects to be created
 */
private synchronized int calculateDeficit(boolean incrementInternal) {
  int objectDeficit = getMinIdle() - getNumIdle();
  if (_maxActive > 0) {
    int growLimit = Math.max(0,
        getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing);
    objectDeficit = Math.min(objectDeficit, growLimit);
  }
  if (incrementInternal && objectDeficit >0) {
    _numInternalProcessing++;
  }
  return objectDeficit;
}
origin: banq/jdonframework

public int getMaxPoolSize() {
  return pool.getMaxActive();
}
origin: geotools/geotools

public int getPoolSize() {
  checkOpen();
  return pool.getMaxActive();
}
origin: geotools/geotools

  @Override
  public String toString() {
    StringBuilder ret = new StringBuilder(getClass().getSimpleName());
    ret.append("[config=").append(getConfig());
    if (pool == null) {
      ret.append("[Session pool is disposed]");
    } else {
      ret.append("[ACTIVE: ");
      ret.append(pool.getNumActive() + "/" + ((GenericObjectPool) pool).getMaxActive());
      ret.append(" INACTIVE: ");
      ret.append(pool.getNumIdle() + "/" + ((GenericObjectPool) pool).getMaxIdle() + "]");
    }
    ret.append("]");
    return ret.toString();
  }
}
origin: geotools/geotools

/** @see org.geotools.arcsde.session.ISessionPool#getAvailableCount() */
public synchronized int getAvailableCount() {
  checkOpen();
  return pool.getMaxActive() - pool.getNumActive();
}
origin: org.mule/mule-core

public int getMaxActive()
{
  return pool.getMaxActive();
}
origin: org.mule.modules/mule-module-xml

/**
 * @return The current maximum number of allowable active transformer objects in
 *         the pool
 */
public int getMaxActiveTransformers()
{
  return transformerPool.getMaxActive();
}
origin: org.mule.modules/mule-module-xml

/**
 * @return The current maximum number of allowable active transformer objects in
 *         the pool
 */
public int getMaxActiveTransformers()
{
  return transformerPool.getMaxActive();
}
origin: uk.org.mygrid.resources/boca-model

public int getReadConnectionMaxPoolSize() {
  return roPool.getMaxActive();
}
origin: uk.org.mygrid.resources/boca-model

public int getWriteConnectionMaxPoolSize() {
  return rwPool.getMaxActive();
}
origin: uk.org.mygrid.resources/boca-model

public int getQueryConnectionMaxPoolSize() {
  return queryPool.getMaxActive();
}
origin: ontopia/ontopia

public void writeReport(java.io.Writer out) throws java.io.IOException {
 final String BR = "<br>\n";
 out.write("Active connections: " + pool.getNumActive() + " (max: " + pool.getMaxActive() + ")<br>\n");
 out.write("Idle connections: " + pool.getNumIdle() + " (min: " + pool.getMinIdle() + " max: " + pool.getMaxIdle() + ")<br>\n");
 out.write("Connections created: " + pcfactory.objectsCreated + BR);
 out.write("Connections destroyed: " + pcfactory.objectsDestroyed + BR);
 out.write("Connections validated: " + pcfactory.objectsValidated + BR);
 out.write("Connections activated: " + pcfactory.objectsActivated + BR);
 out.write("Connections passivated: " + pcfactory.objectsPassivated + BR);
}
origin: mysticfall/pivot4j

  @Override
  public Object invoke(Object proxy, Method method, Object[] args)
      throws Throwable {
    if (method.getName().equals("close")) {
      if (logger.isDebugEnabled()) {
        logger.debug("Return a connection to the pool : "
            + connection);
      }
      pool.returnObject((OlapConnection) proxy);
      if (logger.isDebugEnabled()) {
        logger.debug("	- current pool size : "
            + pool.getNumActive() + " / "
            + pool.getMaxActive());
      }
      return null;
    } else {
      return method.invoke(connection, args);
    }
  }
};
origin: org.apache.commons/com.springsource.org.apache.commons.pool

/**
 * This returns the number of objects to create during the pool
 * sustain cycle. This will ensure that the minimum number of idle
 * instances is maintained without going past the maxActive value.
 *
 * @param incrementInternal - Should the count of objects currently under
 *                            some form of internal processing be
 *                            incremented?
 * @return The number of objects to be created
 */
private synchronized int calculateDeficit(boolean incrementInternal) {
  int objectDeficit = getMinIdle() - getNumIdle();
  if (_maxActive > 0) {
    int growLimit = Math.max(0,
        getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing);
    objectDeficit = Math.min(objectDeficit, growLimit);
  }
  if (incrementInternal && objectDeficit >0) {
    _numInternalProcessing++;
  }
  return objectDeficit;
}
origin: org.apache.commons/pool

/**
 * This returns the number of objects to create during the pool
 * sustain cycle. This will ensure that the minimum number of idle
 * instances is maintained without going past the maxActive value.
 *
 * @param incrementInternal - Should the count of objects currently under
 *                            some form of internal processing be
 *                            incremented?
 * @return The number of objects to be created
 */
private synchronized int calculateDeficit(boolean incrementInternal) {
  int objectDeficit = getMinIdle() - getNumIdle();
  if (_maxActive > 0) {
    int growLimit = Math.max(0,
        getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing);
    objectDeficit = Math.min(objectDeficit, growLimit);
  }
  if (incrementInternal && objectDeficit >0) {
    _numInternalProcessing++;
  }
  return objectDeficit;
}
origin: org.apache.openjpa/openjpa-all

/**
 * This returns the number of objects to create during the pool
 * sustain cycle. This will ensure that the minimum number of idle
 * instances is maintained without going past the maxActive value.
 *
 * @param incrementInternal - Should the count of objects currently under
 *                            some form of internal processing be
 *                            incremented?
 * @return The number of objects to be created
 */
private synchronized int calculateDeficit(boolean incrementInternal) {
  int objectDeficit = getMinIdle() - getNumIdle();
  if (_maxActive > 0) {
    int growLimit = Math.max(0,
        getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing);
    objectDeficit = Math.min(objectDeficit, growLimit);
  }
  if (incrementInternal && objectDeficit >0) {
    _numInternalProcessing++;
  }
  return objectDeficit;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool

/**
 * This returns the number of objects to create during the pool
 * sustain cycle. This will ensure that the minimum number of idle
 * instances is maintained without going past the maxActive value.
 *
 * @param incrementInternal - Should the count of objects currently under
 *                            some form of internal processing be
 *                            incremented?
 * @return The number of objects to be created
 */
private synchronized int calculateDeficit(boolean incrementInternal) {
  int objectDeficit = getMinIdle() - getNumIdle();
  if (_maxActive > 0) {
    int growLimit = Math.max(0,
        getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing);
    objectDeficit = Math.min(objectDeficit, growLimit);
  }
  if (incrementInternal && objectDeficit >0) {
    _numInternalProcessing++;
  }
  return objectDeficit;
}
origin: pentaho/pentaho-platform

new GenericKeyedObjectPoolFactory( null, pool.getMaxActive(), pool.getWhenExhaustedAction(), pool
  .getMaxWait(), pool.getMaxIdle(), maxOpenPreparedStatements );
org.apache.commons.pool.implGenericObjectPoolgetMaxActive

Javadoc

Returns the maximum number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. When non-positive, there is no limit to the number of objects that can be managed by the pool at one time.

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

  • Finding current android device location
  • setScale (BigDecimal)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
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