Tabnine Logo
StackObjectPool.clear
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.apache.commons.pool.impl.StackObjectPool.clear (Showing top 10 results out of 315)

origin: commons-pool/commons-pool

/**
 * <p>Close this pool, and free any resources associated with it. Invokes
 * {@link #clear()} to destroy and remove instances in the pool.</p>
 * 
 * <p>Calling {@link #addObject} or {@link #borrowObject} after invoking
 * this method on a pool will cause them to throw an
 * {@link IllegalStateException}.</p>
 *
 * @throws Exception never - exceptions clearing the pool are swallowed
 */
@Override
public void close() throws Exception {
  super.close();
  clear();
}
origin: commons-pool/commons-pool

/**
 * Sets the {@link PoolableObjectFactory factory} this pool uses
 * to create new instances. Trying to change
 * the <code>factory</code> while there are borrowed objects will
 * throw an {@link IllegalStateException}.
 *
 * @param factory the {@link PoolableObjectFactory} used to create new instances.
 * @throws IllegalStateException when the factory cannot be set at this time
 * @deprecated to be removed in pool 2.0
 */
@Deprecated
@Override
public synchronized void setFactory(PoolableObjectFactory<T> factory) throws IllegalStateException {
  assertOpen();
  if(0 < getNumActive()) {
    throw new IllegalStateException("Objects are already active");
  } else {
    clear();
    _factory = factory;
  }
}
origin: org.apache.commons/pool

/**
 * <p>Close this pool, and free any resources associated with it. Invokes
 * {@link #clear()} to destroy and remove instances in the pool.</p>
 * 
 * <p>Calling {@link #addObject} or {@link #borrowObject} after invoking
 * this method on a pool will cause them to throw an
 * {@link IllegalStateException}.</p>
 *
 * @throws Exception never - exceptions clearing the pool are swallowed
 */
@Override
public void close() throws Exception {
  super.close();
  clear();
}
origin: org.apache.openjpa/openjpa-all

/**
 * <p>Close this pool, and free any resources associated with it. Invokes
 * {@link #clear()} to destroy and remove instances in the pool.</p>
 * 
 * <p>Calling {@link #addObject} or {@link #borrowObject} after invoking
 * this method on a pool will cause them to throw an
 * {@link IllegalStateException}.</p>
 *
 * @throws Exception never - exceptions clearing the pool are swallowed
 */
@Override
public void close() throws Exception {
  super.close();
  clear();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool

/**
 * Close this pool, and free any resources associated with it.
 * <p>
 * Calling {@link #addObject} or {@link #borrowObject} after invoking
 * this method on a pool will cause them to throw an
 * {@link IllegalStateException}.
 * </p>
 *
 * @throws Exception <strong>deprecated</strong>: implementations should silently fail if not all resources can be freed.
 */
public void close() throws Exception {
  super.close();
  clear();
}
origin: org.apache.commons/com.springsource.org.apache.commons.pool

/**
 * Close this pool, and free any resources associated with it.
 * <p>
 * Calling {@link #addObject} or {@link #borrowObject} after invoking
 * this method on a pool will cause them to throw an
 * {@link IllegalStateException}.
 * </p>
 *
 * @throws Exception <strong>deprecated</strong>: implementations should silently fail if not all resources can be freed.
 */
public void close() throws Exception {
  super.close();
  clear();
}
origin: org.apache.commons/pool

/**
 * Sets the {@link PoolableObjectFactory factory} this pool uses
 * to create new instances. Trying to change
 * the <code>factory</code> while there are borrowed objects will
 * throw an {@link IllegalStateException}.
 *
 * @param factory the {@link PoolableObjectFactory} used to create new instances.
 * @throws IllegalStateException when the factory cannot be set at this time
 * @deprecated to be removed in pool 2.0
 */
@Deprecated
@Override
public synchronized void setFactory(PoolableObjectFactory<T> factory) throws IllegalStateException {
  assertOpen();
  if(0 < getNumActive()) {
    throw new IllegalStateException("Objects are already active");
  } else {
    clear();
    _factory = factory;
  }
}
origin: org.apache.openjpa/openjpa-all

/**
 * Sets the {@link PoolableObjectFactory factory} this pool uses
 * to create new instances. Trying to change
 * the <code>factory</code> while there are borrowed objects will
 * throw an {@link IllegalStateException}.
 *
 * @param factory the {@link PoolableObjectFactory} used to create new instances.
 * @throws IllegalStateException when the factory cannot be set at this time
 * @deprecated to be removed in pool 2.0
 */
@Deprecated
@Override
public synchronized void setFactory(PoolableObjectFactory<T> factory) throws IllegalStateException {
  assertOpen();
  if(0 < getNumActive()) {
    throw new IllegalStateException("Objects are already active");
  } else {
    clear();
    _factory = factory;
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool

/**
 * Sets the {@link PoolableObjectFactory factory} this pool uses
 * to create new instances. Trying to change
 * the <code>factory</code> while there are borrowed objects will
 * throw an {@link IllegalStateException}.
 *
 * @param factory the {@link PoolableObjectFactory} used to create new instances.
 * @throws IllegalStateException when the factory cannot be set at this time
 */
public synchronized void setFactory(PoolableObjectFactory factory) throws IllegalStateException {
  assertOpen();
  if(0 < getNumActive()) {
    throw new IllegalStateException("Objects are already active");
  } else {
    clear();
    _factory = factory;
  }
}
origin: org.apache.commons/com.springsource.org.apache.commons.pool

/**
 * Sets the {@link PoolableObjectFactory factory} this pool uses
 * to create new instances. Trying to change
 * the <code>factory</code> while there are borrowed objects will
 * throw an {@link IllegalStateException}.
 *
 * @param factory the {@link PoolableObjectFactory} used to create new instances.
 * @throws IllegalStateException when the factory cannot be set at this time
 */
public synchronized void setFactory(PoolableObjectFactory factory) throws IllegalStateException {
  assertOpen();
  if(0 < getNumActive()) {
    throw new IllegalStateException("Objects are already active");
  } else {
    clear();
    _factory = factory;
  }
}
org.apache.commons.pool.implStackObjectPoolclear

Javadoc

Clears any objects sitting idle in the pool.

Popular methods of StackObjectPool

  • <init>
    Create a new SimpleObjectPool using the specified factory to create new instances, capping the numbe
  • assertOpen
  • getNumActive
    Return the number of instances currently borrowed from this pool.
  • isClosed

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • Menu (java.awt)
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JCheckBox (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 12 Jupyter Notebook extensions
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