Package org.jgroups.util
Class ThreadCreator
java.lang.Object
org.jgroups.util.ThreadCreator
- Since:
- Helper class to create regular or virtual threads. Virtual threads are not supported for versions less than Java 17.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final MethodHandleprivate static final MethodHandleprivate static final Logprivate static final MethodHandles.Lookupprivate static final MethodHandleprivate static final Class<?> private static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadcreateThread(Runnable r, String name, boolean daemon, boolean virtual) static ExecutorServicecreateThreadPool(int min_threads, int max_threads, long keep_alive_time, boolean virtual_threads, Log log) static ExecutorServicecreateThreadPool(int min_threads, int max_threads, long keep_alive_time, String rejection_policy, BlockingQueue<Runnable> queue, ThreadFactory factory, boolean useVirtualThreads, Log log) protected static MethodHandleprotected static MethodHandleprotected static Class<?> protected static MethodHandlestatic boolean
-
Field Details
-
LOG
-
LOOKUP
-
OF_VIRTUAL_NAME
- See Also:
-
OF_VIRTUAL_CLASS
-
OF_VIRTUAL
-
CREATE_VTHREAD
-
EXECUTORS_NEW_VIRTUAL_THREAD_FACTORY
-
-
Constructor Details
-
ThreadCreator
public ThreadCreator()
-
-
Method Details
-
hasVirtualThreads
public static boolean hasVirtualThreads() -
getCreateVThreadHandle
-
getOfVirtualClass
-
getOfVirtualHandle
-
getNewVirtualThreadFactoryHandle
-
createThread
-
createThreadPool
public static ExecutorService createThreadPool(int min_threads, int max_threads, long keep_alive_time, boolean virtual_threads, Log log) -
createThreadPool
public static ExecutorService createThreadPool(int min_threads, int max_threads, long keep_alive_time, String rejection_policy, BlockingQueue<Runnable> queue, ThreadFactory factory, boolean useVirtualThreads, Log log)
-