public final class ThreadExtensions extends Object
ThreadExtensions.| Constructor and Description |
|---|
ThreadExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static List<ThreadDataBean> |
newThreadData()
Finds all threads the are currently running and converts them to
ThreadDataBean and
puts them to a List that is returned. |
static Thread[] |
resolveRunningThreads()
Finds all threads the are currently running.
|
static <T> T |
runAsyncSupplierWithCpuCores(Supplier<T> supplier,
int cpuCores)
Creates a custom thread pool that are executed in parallel processes with the will run with
the given number of the cpu cores
|
static <T> T |
runCallableWithCpuCores(Callable<T> task,
int cpuCores)
Creates a custom thread pool that are executed in parallel processes with the given number of
the cpu cores
|
public static <T> T runCallableWithCpuCores(Callable<T> task, int cpuCores) throws ExecutionException, InterruptedException
T - the generic type of the resulttask - the Callable task to executecpuCores - the number of the cpu cores to run withExecutionException - if the computation threw an exceptionInterruptedException - if the current thread is not a member of a ForkJoinPool and was interrupted while
waitingpublic static <T> T runAsyncSupplierWithCpuCores(Supplier<T> supplier, int cpuCores) throws ExecutionException, InterruptedException
T - the generic type of the resultsupplier - the Supplier task to executecpuCores - the number of the cpu cores to run withExecutionException - if the computation threw an exceptionInterruptedException - if the current thread is not a member of a ForkJoinPool and was interrupted while
waitingpublic static Thread[] resolveRunningThreads()
public static List<ThreadDataBean> newThreadData()
ThreadDataBean and
puts them to a List that is returned.ListCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.