public class ThreadUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ThreadUtil.AsyncRunInterface |
| Constructor and Description |
|---|
ThreadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
asyncWithoutReturn(ThreadPoolExecutor threadPoolExecutor,
ThreadUtil.AsyncRunInterface asyncRunInterface)
设置多线程处理,不等待处理完即返回
|
static void |
asyncWithReturn(ThreadPoolExecutor threadPoolExecutor,
Integer maxThreadNum,
ThreadUtil.AsyncRunInterface asyncRunInterface)
设置多线程处理,等待处理完才返回
|
static ScheduledExecutorService |
initScheduledExecutorService(String name,
boolean isDaemon,
Integer poolSize) |
static ThreadPoolExecutor |
initThreadPoolExecutorAbort() |
static ThreadPoolExecutor |
initThreadPoolExecutorAbort(int corePoolSize,
int coreMaxPoolSize) |
static void |
sleep(Long millionSeconds) |
public static ScheduledExecutorService initScheduledExecutorService(String name, boolean isDaemon, Integer poolSize)
public static ThreadPoolExecutor initThreadPoolExecutorAbort()
public static ThreadPoolExecutor initThreadPoolExecutorAbort(int corePoolSize, int coreMaxPoolSize)
corePoolSize - coreMaxPoolSize - public static void sleep(Long millionSeconds)
public static void asyncWithoutReturn(ThreadPoolExecutor threadPoolExecutor, ThreadUtil.AsyncRunInterface asyncRunInterface)
public static void asyncWithReturn(ThreadPoolExecutor threadPoolExecutor, Integer maxThreadNum, ThreadUtil.AsyncRunInterface asyncRunInterface)
Copyright © 2024. All Rights Reserved.