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

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

Best Java code snippets using org.apache.commons.pool.impl.GenericObjectPool.clear (Showing top 16 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

/**
 * <p>Closes the pool.  Once the pool is closed, {@link #borrowObject()}
 * will fail with IllegalStateException, but {@link #returnObject(Object)} and
 * {@link #invalidateObject(Object)} will continue to work, with returned objects
 * destroyed on return.</p>
 * 
 * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p> 
 * 
 * @throws Exception
 */
@Override
public void close() throws Exception {
  super.close();
  synchronized (this) {
    clear();
    startEvictor(-1L);
    while(_allocationQueue.size() > 0) {
      Latch<T> l = _allocationQueue.removeFirst();
      
      synchronized (l) {
        // notify the waiting thread
        l.notify();
      }
    }
  }
}
origin: banq/jdonframework

public void close() {
  pool.clear();
  try {
    pool.close();
  } catch (Exception e) {
  }
}
origin: org.mule/mule-core

public void clear()
{
  if (pool != null)
  {
    pool.clear();
  }
}
origin: org.apache.openjpa/openjpa-kernel

private void clearAllSockets() {
  _socketPool.clear();
}
origin: org.apache.openjpa/openjpa-all

private void clearAllSockets() {
  _socketPool.clear();
}
origin: org.apache.openjpa/com.springsource.org.apache.openjpa

private void clearAllSockets() {
  _socketPool.clear();
}
origin: org.apache.openejb.patch/openjpa

private void clearAllSockets() {
  _socketPool.clear();
}
origin: org.apache.openejb.patch/openjpa-kernel

private void clearAllSockets() {
  _socketPool.clear();
}
origin: org.onehippo.cms7.hst.components/hst-session-pool

public void clear() {
  if (this.sessionPool != null) {
    try {
      this.sessionPool.clear();
    } catch (Exception e) {
      if (log.isDebugEnabled()) {
        log.warn("Failed to clear session pool.", e);
      } else if (log.isWarnEnabled()) {
        log.warn("Failed to clear session pool. {}", e.toString());
      }
    }
  }
}

origin: org.apache.openjpa/openjpa-all

/**
 * <p>Closes the pool.  Once the pool is closed, {@link #borrowObject()}
 * will fail with IllegalStateException, but {@link #returnObject(Object)} and
 * {@link #invalidateObject(Object)} will continue to work, with returned objects
 * destroyed on return.</p>
 * 
 * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p> 
 * 
 * @throws Exception
 */
@Override
public void close() throws Exception {
  super.close();
  synchronized (this) {
    clear();
    startEvictor(-1L);
    while(_allocationQueue.size() > 0) {
      Latch<T> l = _allocationQueue.removeFirst();
      
      synchronized (l) {
        // notify the waiting thread
        l.notify();
      }
    }
  }
}
origin: org.apache.commons/pool

/**
 * <p>Closes the pool.  Once the pool is closed, {@link #borrowObject()}
 * will fail with IllegalStateException, but {@link #returnObject(Object)} and
 * {@link #invalidateObject(Object)} will continue to work, with returned objects
 * destroyed on return.</p>
 * 
 * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p> 
 * 
 * @throws Exception
 */
@Override
public void close() throws Exception {
  super.close();
  synchronized (this) {
    clear();
    startEvictor(-1L);
    while(_allocationQueue.size() > 0) {
      Latch<T> l = _allocationQueue.removeFirst();
      
      synchronized (l) {
        // notify the waiting thread
        l.notify();
      }
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool

/**
 * Closes the pool.  Once the pool is closed, {@link #borrowObject()}
 * will fail with IllegalStateException, but {@link #returnObject(Object)} and
 * {@link #invalidateObject(Object)} will continue to work. This method does not
 * {@link #clear()} the pool. The method is idempotent - that is, it is OK to call it on a closed
 * pool. 
 * 
 * @throws Exception
 */
public void close() throws Exception {
  super.close();
  synchronized (this) {
    clear();
    startEvictor(-1L);
  }
}
origin: org.apache.commons/com.springsource.org.apache.commons.pool

/**
 * Closes the pool.  Once the pool is closed, {@link #borrowObject()}
 * will fail with IllegalStateException, but {@link #returnObject(Object)} and
 * {@link #invalidateObject(Object)} will continue to work. This method does not
 * {@link #clear()} the pool. The method is idempotent - that is, it is OK to call it on a closed
 * pool. 
 * 
 * @throws Exception
 */
public void close() throws Exception {
  super.close();
  synchronized (this) {
    clear();
    startEvictor(-1L);
  }
}
origin: org.apache.tapestry/com.springsource.org.apache.tapestry

public void registryDidShutdown()
{
  try
  {
    _contextPool.clear();
    _contextPool.close();
    OgnlRuntime.clearCache();
    Introspector.flushCaches();
    
  } catch (Exception et) {
    // ignore
  }
}
origin: org.apache.tapestry/tapestry-framework

public void registryDidShutdown()
{
  try
  {
    _contextPool.clear();
    _contextPool.close();
    OgnlRuntime.clearCache();
    Introspector.flushCaches();
    
  } catch (Exception et) {
    // ignore
  }
}
origin: lumongo/lumongo

public void reloadIndexSettings() throws Exception {
  indexLock.writeLock().lock();
  try {
    IndexConfig newIndexConfig = loadIndexSettings(mongo, mongoConfig.getDatabaseName(), indexName);
    IndexSettings indexSettings = newIndexConfig.getIndexSettings();
    indexConfig.configure(indexSettings);
    parsers.clear();
    //force analyzer to be fetched first so it doesn't fail only on one segment below
    getPerFieldAnalyzer();
    for (LumongoSegment s : segmentMap.values()) {
      try {
        s.updateIndexSettings(indexSettings);
      }
      catch (Exception ignored) {
      }
    }
  }
  finally {
    indexLock.writeLock().unlock();
  }
}
org.apache.commons.pool.implGenericObjectPoolclear

Javadoc

Clears any objects sitting idle in the pool by removing them from the idle instance pool and then invoking the configured PoolableObjectFactory#destroyObject(Object) method on each idle instance.

Implementation notes:

  • This method does not destroy or effect in any way instances that are checked out of the pool when it is invoked.
  • Invoking this method does not prevent objects being returned to the idle instance pool, even during its execution. It locks the pool only during instance removal. Additional instances may be returned while removed items are being destroyed.

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
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