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

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

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

  • 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: BroadleafCommerce/BroadleafCommerce

@Override
public void close() throws SQLException {
  try {
    connectionPool.returnObject(this);
  } catch (Exception e) {
    throw new SQLException(e);
  }
}
origin: weibocom/motan

protected void returnObject(Channel channel) {
  if (channel == null) {
    return;
  }
  try {
    pool.returnObject(channel);
  } catch (Exception ie) {
    LoggerUtil.error(this.getClass().getSimpleName() + " return client Error: url=" + url.getUri(), ie);
  }
}
origin: commons-pool/commons-pool

returnObject(latch.getPair().getValue());
origin: banq/jdonframework

public void releasePoolable(Object object) throws Exception {
  this.pool.returnObject(object);
}
origin: geotools/geotools

/**
 * Return the session Object to the ConnectionPool. Method must be synchronized, in order to
 * prevent SessionPool from opening more connections than in max.Connection defined under heavy
 * load
 *
 * @param session
 * @throws Exception
 */
public synchronized void returnObject(Session session) throws Exception {
  openSessionsNonTransactional.remove(session);
  pool.returnObject(session);
}
origin: geotools/geotools

pool.returnObject(preload[i]);
origin: apache/jackrabbit-oak

  /**
   * Places the given LdapConnection back in the pool.
   *
   * @param connection the LdapConnection to be released
   * @throws Exception if an error occurs while releasing the connection
   */
  public void releaseConnection(LdapConnection connection) throws Exception {
    super.returnObject(connection);
  }
}
origin: iipc/openwayback

public void returnJedisInstance(Jedis jedis)
{
  if (jedis == null) {
    return;
  }
        
  //pool.returnResource(jedis);
  try {
    goPool.returnObject(jedis);
  } catch (Exception e) {
    LOGGER.warning("REDISCONN: RETURN: " + e);
  }
}

origin: org.eobjects.analyzerbeans/AnalyzerBeans-core

private void returnObject(Integer poolObject) {
  try {
    _connectionPool.returnObject(poolObject);
  } catch (Exception e) {
    throw new IllegalStateException("Could not return pool object", e);
  }
}
origin: org.netpreserve.openwayback/openwayback-core

public void returnJedisInstance(Jedis jedis)
{
  if (jedis == null) {
    return;
  }
        
  //pool.returnResource(jedis);
  try {
    goPool.returnObject(jedis);
  } catch (Exception e) {
    LOGGER.warning("REDISCONN: RETURN: " + e);
  }
}

origin: com.atlassian.jira/jira-core

public void put(Parser parser)
{
  try
  {
    pool.returnObject(parser);
  }
  catch (Exception e)
  {
    throw new RuntimeException("Error returning a parser to the pool", e);
  }
}
origin: ro.isdc.wro4j/wro4j-extensions

public void returnObject(final T engine) {
 notNull(engine);
 try {
  objectPool.returnObject(engine);
 } catch (final Exception e) {
  // should never happen
  throw new RuntimeException("Cannot get object from the pool", e);
 }
}
origin: alexo/wro4j

public void returnObject(final T engine) {
 notNull(engine);
 try {
  objectPool.returnObject(engine);
 } catch (final Exception e) {
  // should never happen
  throw new RuntimeException("Cannot get object from the pool", e);
 }
}
origin: org.mobicents.diameter/jdiameter-impl

protected void returnTimerTaskHandle(TimerTaskHandle timerTaskHandle) {
 try {
  pool.returnObject(timerTaskHandle);
 }
 catch (Exception e) {
  logger.warn(e.getMessage());
 }
}
origin: org.lasersonlab.apache.parquet/parquet-hadoop

private void returnToPool(Object obj, Map<Class<?>, GenericObjectPool> pools) {
 try {
  GenericObjectPool pool = pools.get(obj.getClass());
  if (pool == null) {
   throw new IllegalStateException("Received unexpected compressor or decompressor, " +
     "cannot be returned to any available pool: " + obj.getClass().getSimpleName());
  }
  pool.returnObject(obj);
 } catch (Exception e) {
  throw new ParquetCompressionCodecException(e);
 }
}
origin: com.baidu.beidou/navi-pbrpc

/**
 * 返回对象到池中
 * 
 * @param resource
 */
public void returnResourceObject(final Object resource) {
  try {
    internalPool.returnObject(resource);
  } catch (Exception e) {
    throw new PbrpcException("Could not return the resource to the pool", e);
  }
}
origin: neoremind/navi-pbrpc

/**
 * 返回对象到池中
 * 
 * @param resource
 */
public void returnResourceObject(final Object resource) {
  try {
    internalPool.returnObject(resource);
  } catch (Exception e) {
    throw new PbrpcException("Could not return the resource to the pool", e);
  }
}
origin: org.apache.metamodel/MetaModel-jdbc

public void returnLease(JdbcCompiledQueryLease lease) {
  if (logger.isDebugEnabled()) {
    logger.debug("Returning lease. Leases (before): Active={}, Idle={}", getActiveLeases(), getIdleLeases());
  }
  try {
    _pool.returnObject(lease);
  } catch (Exception e) {
    throw handleError(e, "return lease");
  }
}
origin: apache/metamodel

public void returnLease(JdbcCompiledQueryLease lease) {
  if (logger.isDebugEnabled()) {
    logger.debug("Returning lease. Leases (before): Active={}, Idle={}", getActiveLeases(), getIdleLeases());
  }
  try {
    _pool.returnObject(lease);
  } catch (Exception e) {
    throw handleError(e, "return lease");
  }
}
origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.proxy

@Override
public List<String> getActionableResourcesForAlias(String alias, String appId) throws Exception {
  EntitlementServiceStub stub = null;
  try {
    stub = getEntitlementStub(serverUrl);
    return getResources(getEntitledAttributes(alias, null, ProxyConstants.SUBJECT_ID, null, true, stub));
  } finally {
    if (stub != null) {
      stub._getServiceClient().cleanupTransport();
      serviceStubPool.returnObject(stub);
    }
  }
}
org.apache.commons.pool.implGenericObjectPoolreturnObject

Javadoc

Returns an object instance to the pool.

If #getMaxIdle() is set to a positive value and the number of idle instances has reached this value, the returning instance is destroyed.

If #getTestOnReturn() == true, the returning instance is validated before being returned to the idle instance pool. In this case, if validation fails, the instance is destroyed.

Note: There is no guard to prevent an object being returned to the pool multiple times. Clients are expected to discard references to returned objects and ensure that an object is not returned to the pool multiple times in sequence (i.e., without being borrowed again between returns). Violating this contract will result in the same object appearing multiple times in the pool and pool counters (numActive, numIdle) returning incorrect values.

Popular methods of GenericObjectPool

  • <init>
    Create a new GenericObjectPool using the specified values.
  • 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
  • getNumActive
    Return the number of instances currently borrowed from this pool.
  • setWhenExhaustedAction,
  • getNumActive,
  • getNumIdle,
  • setTestWhileIdle,
  • setNumTestsPerEvictionRun,
  • setTestOnReturn,
  • invalidateObject,
  • clear,
  • addObject

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • JButton (javax.swing)
  • JList (javax.swing)
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