Package com.powsybl.commons.concurrent
Class CleanableExecutors
- java.lang.Object
-
- com.powsybl.commons.concurrent.CleanableExecutors
-
public final class CleanableExecutors extends Object
Thread pool executors that can execute cleaning tasks each time a thread go back to the pool.- Author:
- Geoffroy Jamgotchian
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CleanableExecutors.CleanableThreadPoolExecutor
static interface
CleanableExecutors.ThreadCleaner
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorService
newCachedThreadPool()
static ExecutorService
newCachedThreadPool(String poolName)
static ExecutorService
newCachedThreadPool(String poolName, Iterable<CleanableExecutors.ThreadCleaner> cleaners)
static ExecutorService
newFixedThreadPool(int nThreads)
static ExecutorService
newFixedThreadPool(String poolName, int nThreads)
static ExecutorService
newFixedThreadPool(String poolName, int nThreads, Iterable<CleanableExecutors.ThreadCleaner> cleaners)
static ExecutorService
newSizeLimitedThreadPool(int maxSize)
static ExecutorService
newSizeLimitedThreadPool(String poolName, int maxSize)
static ExecutorService
newSizeLimitedThreadPool(String poolName, int maxSize, Iterable<CleanableExecutors.ThreadCleaner> cleaners)
-
-
-
Method Detail
-
newFixedThreadPool
public static ExecutorService newFixedThreadPool(int nThreads)
-
newFixedThreadPool
public static ExecutorService newFixedThreadPool(String poolName, int nThreads)
-
newFixedThreadPool
public static ExecutorService newFixedThreadPool(String poolName, int nThreads, Iterable<CleanableExecutors.ThreadCleaner> cleaners)
-
newCachedThreadPool
public static ExecutorService newCachedThreadPool()
-
newCachedThreadPool
public static ExecutorService newCachedThreadPool(String poolName)
-
newCachedThreadPool
public static ExecutorService newCachedThreadPool(String poolName, Iterable<CleanableExecutors.ThreadCleaner> cleaners)
-
newSizeLimitedThreadPool
public static ExecutorService newSizeLimitedThreadPool(int maxSize)
-
newSizeLimitedThreadPool
public static ExecutorService newSizeLimitedThreadPool(String poolName, int maxSize)
-
newSizeLimitedThreadPool
public static ExecutorService newSizeLimitedThreadPool(String poolName, int maxSize, Iterable<CleanableExecutors.ThreadCleaner> cleaners)
-
-