public class ThreadUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ThreadUtil.ThreadFactoryImpl |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
THREAD_NAME |
| Constructor and Description |
|---|
ThreadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static IExecutor |
createExecutor(int threadCount,
java.lang.String threadFactoryName) |
static java.lang.String |
currentThreadInfo()
Returns a readable name of the current executing thread.
|
static void |
execute(java.lang.String name,
java.util.List<? extends java.lang.Runnable> tasks,
int threadPoolSize,
long timeout,
boolean triggerAtOnce)
Parallel execution of the
tasks. |
static boolean |
isTestNGThread() |
public static final java.lang.String THREAD_NAME
public static boolean isTestNGThread()
public static void execute(java.lang.String name,
java.util.List<? extends java.lang.Runnable> tasks,
int threadPoolSize,
long timeout,
boolean triggerAtOnce)
tasks. The startup is synchronized so this method
emulates a load test.tasks - the list of tasks to be runthreadPoolSize - the size of the parallel threads to be used to execute the taskstimeout - a maximum timeout to wait for tasks finalizationtriggerAtOnce - true if the parallel execution of tasks should be trigger at oncepublic static java.lang.String currentThreadInfo()
public static IExecutor createExecutor(int threadCount, java.lang.String threadFactoryName)