Example usage for java.util.concurrent ThreadPoolExecutor isTerminating

List of usage examples for java.util.concurrent ThreadPoolExecutor isTerminating

Introduction

In this page you can find the example usage for java.util.concurrent ThreadPoolExecutor isTerminating.

Prototype

public boolean isTerminating() 

Source Link

Document

Returns true if this executor is in the process of terminating after #shutdown or #shutdownNow but has not completely terminated.

Usage

From source file:org.apache.hadoop.hbase.index.parallel.ThreadPoolManager.java

static synchronized ThreadPoolExecutor getExecutor(ThreadPoolBuilder builder, Map<String, Object> poolCache) {
    ThreadPoolExecutor pool = (ThreadPoolExecutor) poolCache.get(builder.getName());
    if (pool == null || pool.isTerminating() || pool.isShutdown()) {
        pool = getDefaultExecutor(builder);
        LOG.info("Creating new pool for " + builder.getName());
        poolCache.put(builder.getName(), pool);
    }//  w w  w  . j a  v a 2  s.com
    ((ShutdownOnUnusedThreadPoolExecutor) pool).addReference();

    return pool;
}