congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GenericObjectPool.getMaxActive
Code IndexAdd Tabnine 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)

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

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • putExtra (Intent)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • JLabel (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Join (org.hibernate.mapping)
  • CodeWhisperer 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