public class ExecutorUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ExecutorUtil.InheritableThreadLocalProvider
Any class which wants to carry forward the threadlocal values to the threads run
by threadpools must implement this interface and the implementation should be
registered here
|
static class |
ExecutorUtil.MDCAwareThreadPoolExecutor |
| 构造器和说明 |
|---|
ExecutorUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addThreadLocalProvider(ExecutorUtil.InheritableThreadLocalProvider provider) |
static void |
awaitTermination(ExecutorService pool) |
static boolean |
isSolrServerThread() |
static ExecutorService |
newMDCAwareCachedThreadPool(int maxThreads,
ThreadFactory threadFactory) |
static ExecutorService |
newMDCAwareCachedThreadPool(String name)
Create a cached thread pool using a named thread factory
|
static ExecutorService |
newMDCAwareCachedThreadPool(ThreadFactory threadFactory)
|
static ExecutorService |
newMDCAwareFixedThreadPool(int nThreads,
ThreadFactory threadFactory)
|
static ExecutorService |
newMDCAwareSingleThreadExecutor(ThreadFactory threadFactory)
|
static ExecutorService |
newMDCAwareSingleThreadExecutorWithKeepAlive(ThreadFactory threadFactory,
long keepAlive)
|
static void |
setServerThreadFlag(Boolean flag) |
static void |
shutdownAndAwaitTermination(ExecutorService pool) |
static void |
shutdownNowAndAwaitTermination(ExecutorService pool) |
public static void addThreadLocalProvider(ExecutorUtil.InheritableThreadLocalProvider provider)
public static void shutdownAndAwaitTermination(ExecutorService pool)
public static void shutdownNowAndAwaitTermination(ExecutorService pool)
public static void awaitTermination(ExecutorService pool)
public static ExecutorService newMDCAwareFixedThreadPool(int nThreads, ThreadFactory threadFactory)
public static ExecutorService newMDCAwareSingleThreadExecutor(ThreadFactory threadFactory)
public static ExecutorService newMDCAwareSingleThreadExecutorWithKeepAlive(ThreadFactory threadFactory, long keepAlive)
threadFactory - factory of threadkeepAlive - keep alive time(ms)public static ExecutorService newMDCAwareCachedThreadPool(String name)
public static ExecutorService newMDCAwareCachedThreadPool(ThreadFactory threadFactory)
public static ExecutorService newMDCAwareCachedThreadPool(int maxThreads, ThreadFactory threadFactory)
public static boolean isSolrServerThread()
public static void setServerThreadFlag(Boolean flag)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.