public class ExecutorUtil extends Object
Modifier and Type | Class and Description |
---|---|
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 |
Constructor and Description |
---|
ExecutorUtil() |
Modifier and Type | Method and Description |
---|---|
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 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 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 © 2000-2021 Apache Software Foundation. All Rights Reserved.