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

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

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

protected void invalidateObject(Channel nettyChannel) {
  if (nettyChannel == null) {
    return;
  }
  try {
    pool.invalidateObject(nettyChannel);
  } catch (Exception ie) {
    LoggerUtil.error(this.getClass().getSimpleName() + " invalidate client Error: url=" + url.getUri(), ie);
  }
}
origin: org.apache.openejb.patch/openjpa-kernel

private void closeSocket(Socket s) {
  // All sockets come from the pool.
  // This socket is no longer usable, so delete it from the
  // pool.
  try {
    _socketPool.invalidateObject(s);
  } catch (Exception e) {
  }
}
origin: org.apache.openejb.patch/openjpa

private void closeSocket(Socket s) {
  // All sockets come from the pool.
  // This socket is no longer usable, so delete it from the
  // pool.
  try {
    _socketPool.invalidateObject(s);
  } catch (Exception e) {
  }
}
origin: org.apache.openjpa/openjpa-all

private void closeSocket(Socket s) {
  // All sockets come from the pool.
  // This socket is no longer usable, so delete it from the
  // pool.
  try {
    _socketPool.invalidateObject(s);
  } catch (Exception e) {
  }
}
origin: org.apache.openjpa/openjpa-kernel

private void closeSocket(Socket s) {
  // All sockets come from the pool.
  // This socket is no longer usable, so delete it from the
  // pool.
  try {
    _socketPool.invalidateObject(s);
  } catch (Exception e) {
  }
}
origin: org.apache.openjpa/com.springsource.org.apache.openjpa

private void closeSocket(Socket s) {
  // All sockets come from the pool.
  // This socket is no longer usable, so delete it from the
  // pool.
  try {
    _socketPool.invalidateObject(s);
  } catch (Exception e) {
  }
}
origin: iipc/openwayback

public void returnBrokenJedis(Jedis jedis)
{
  if (jedis == null) {
    return;
  }
  
  ((JedisValid)jedis).valid = false;
  
  try {
    goPool.invalidateObject(jedis);
  } catch (Exception e) {
    LOGGER.warning("REDISCONN: BROKEN: " + e);
  }
  //pool.returnBrokenResource(jedis);
}

origin: org.netpreserve.openwayback/openwayback-core

public void returnBrokenJedis(Jedis jedis)
{
  if (jedis == null) {
    return;
  }
  
  ((JedisValid)jedis).valid = false;
  
  try {
    goPool.invalidateObject(jedis);
  } catch (Exception e) {
    LOGGER.warning("REDISCONN: BROKEN: " + e);
  }
  //pool.returnBrokenResource(jedis);
}

origin: neoremind/navi-pbrpc

/**
 * 返回一个调用失败的对象到池中
 * 
 * @param resource
 */
protected void returnBrokenResourceObject(final Object resource) {
  try {
    internalPool.invalidateObject(resource);
  } catch (Exception e) {
    throw new PbrpcException("Could not return the resource to the pool", e);
  }
}
origin: deegree/deegree3

  public void invalidate( DelegatingConnection conn )
              throws Exception {
    conn.getDelegate().close();
    pool.invalidateObject( conn );
  }
}
origin: com.baidu.beidou/navi-pbrpc

/**
 * 返回一个调用失败的对象到池中
 * 
 * @param resource
 */
protected void returnBrokenResourceObject(final Object resource) {
  try {
    internalPool.invalidateObject(resource);
  } catch (Exception e) {
    throw new PbrpcException("Could not return the resource to the pool", e);
  }
}
origin: openstack/monasca-common

/**
 * Call this if the client is unusable (i.e., exception).
 *
 * @param client Client to discard.
 */
public void discard(AuthClient client) {
 try {
  pool.invalidateObject(client);
 } catch (Exception e) {
  System.out.println("AuthConnection problem destorying");
  throw new AuthConnectionException("Failed to destroy client", e);
 }
}
origin: org.hobsoft.symmetry/symmetry-core

/**
 * {@inheritDoc}
 */
@Override
public void invalidateComponent(Object component) throws ComponentPoolException
{
  try
  {
    pool.invalidateObject(component);
  }
  catch (Exception exception)
  {
    throw new ComponentPoolException("Cannot invalidate component in pool", exception);
  }
}
 
origin: org.apache.openjpa/openjpa-all

/**
 * Invalidates an object from the pool.
 *
 * @param obj object to be returned
 * @throws Exception if an exception occurs invalidating the object
 */
public void invalidateObject(Object obj) throws Exception {
  if (config != null && config.getRemoveAbandoned()) {
    synchronized (trace) {
      boolean foundObject = trace.remove(obj);
      if (!foundObject) {
        return; // This connection has already been invalidated.  Stop now.
      }
    }
  }
  super.invalidateObject(obj);        
}
origin: org.everit.osgi.bundles/org.everit.osgi.bundles.commons-dbcp

/**
 * Invalidates an object from the pool.
 *
 * @param obj object to be returned
 * @throws Exception if an exception occurs invalidating the object
 */
public void invalidateObject(Object obj) throws Exception {
  if (config != null && config.getRemoveAbandoned()) {
    synchronized (trace) {
      boolean foundObject = trace.remove(obj);
      if (!foundObject) {
        return; // This connection has already been invalidated.  Stop now.
      }
    }
  }
  super.invalidateObject(obj);        
}
origin: org.apache.commons/com.springsource.org.apache.commons.dbcp

/**
 * Invalidates an object from the pool.
 *
 * @param obj object to be returned
 * @throws Exception if an exception occurs invalidating the object
 */
public void invalidateObject(Object obj) throws Exception {
  if (config != null && config.getRemoveAbandoned()) {
    synchronized (trace) {
      boolean foundObject = trace.remove(obj);
      if (!foundObject) {
        return; // This connection has already been invalidated.  Stop now.
      }
    }
  }
  super.invalidateObject(obj);        
}
origin: org.wso2.transport.http/org.wso2.transport.http.netty

public void invalidateTargetChannel(TargetChannel targetChannel) throws Exception {
  this.connGlobalPool.get(targetChannel.getHttpRoute().toString()).invalidateObject(targetChannel);
}
origin: org.wso2.carbon.transport/org.wso2.carbon.transport.http.netty

@Override
public void destroyObject(Object o) throws Exception {
  if (((TargetChannel) o).getChannel().isActive()) {
    if (log.isDebugEnabled()) {
      log.debug("Original Channel " + ((TargetChannel) o).getChannel().id() + " is returned to the pool. ");
    }
    this.genericObjectPool.returnObject(o);
  } else {
    if (log.isDebugEnabled()) {
      log.debug("Original Channel is destroyed. ");
    }
    this.genericObjectPool.invalidateObject(o);
  }
}
origin: org.wso2.carbon.transport/org.wso2.carbon.transport.http.netty

public void invalidateTargetChannel(TargetChannel targetChannel) throws Exception {
  targetChannel.setRequestWritten(false);
  if (targetChannel.getCorrelatedSource() != null) {
    Map<String, GenericObjectPool> objectPoolMap = targetChannel.getCorrelatedSource().getTargetChannelPool();
    try {
      // Need a null check because SourceHandler side could timeout before TargetHandler side.
      if (objectPoolMap.get(targetChannel.getHttpRoute().toString()) != null) {
        objectPoolMap.get(targetChannel.getHttpRoute().toString()).invalidateObject(targetChannel);
      }
    } catch (Exception e) {
      throw new Exception("Cannot invalidate channel from pool", e);
    }
  }
}
origin: shunyang/thrift-all

private InvocationHandler makeProxyHandler() throws Exception{
  ThriftServiceClient2Proxy handler = null;
  TServiceClient client = pool.borrowObject();
  try {
    handler = new ThriftServiceClient2Proxy(client);
    pool.returnObject(client);
  }catch (Exception e){
    pool.invalidateObject(client);
    throw new ThriftException("获取代理对象失败");
  }
  return handler;
}
org.apache.commons.pool.implGenericObjectPoolinvalidateObject

Javadoc

Invalidates the given object instance. Decrements the active count and destroys the instance.

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,
  • 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