Example usage for org.apache.commons.pool2 ObjectPool close

List of usage examples for org.apache.commons.pool2 ObjectPool close

Introduction

In this page you can find the example usage for org.apache.commons.pool2 ObjectPool close.

Prototype

void close();

Source Link

Document

Close this pool, and free any resources associated with it.

Usage

From source file:com.adaptris.core.services.splitter.ServiceWorkerPool.java

public static void closeQuietly(ObjectPool<?> pool) {
    try {//from w  w  w  .ja v a 2 s .  c o m
        if (pool != null)
            pool.close();
    } catch (Exception ignored) {

    }
}

From source file:com.adaptris.core.services.splitter.ServiceWorkerPool.java

/**
 * //from w  ww .j a va2s  .  c o  m
 * @deprecated since 3.8.3 switch to commons-pool2 instead.
 */
@Deprecated
@Removal(version = "3.9.0", message = "use commons-pool2 variant instead")
public static void closeQuietly(org.apache.commons.pool.ObjectPool<?> pool) {
    logDeprecationWarning();
    try {
        if (pool != null)
            pool.close();
    } catch (Exception ignored) {

    }
}

From source file:com.mirth.connect.connectors.file.FileConnector.java

/**
 * Registers a listener for a particular directory The following properties can be overriden in
 * the endpoint declaration/*w ww.ja v a 2 s  .co m*/
 * <ul>
 * <li>moveToDirectory</li>
 * <li>filterPatterns</li>
 * <li>filterClass</li>
 * <li>pollingFrequency</li>
 * </ul>
 */

protected synchronized void doStop() throws FileConnectorException {
    if (outputStream != null) {
        try {
            outputStream.close();
        } catch (IOException e) {
            logger.warn("Failed to close file output stream on stop: " + e);
        }
    }
    try {
        for (Iterator<ObjectPool<FileSystemConnection>> it = pools.values().iterator(); it.hasNext();) {
            ObjectPool<FileSystemConnection> pool = it.next();
            pool.close();
        }
        pools.clear();
    } catch (Exception e) {
        throw new FileConnectorException(e);
    }
}