Package org.jgroups.util
Class ThreadPool
java.lang.Object
org.jgroups.util.ThreadPool
- All Implemented Interfaces:
Lifecycle
Thread pool based on
ThreadPoolExecutor- Since:
- 5.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Addressprotected intprotected booleanprotected booleanprotected longprotected Logprotected intprotected intprotected final LongAdderprotected Stringprotected StringDeprecated.protected booleanprotected intDeprecated.protected ThreadFactoryprotected Executorprotected SuppressLog<String> protected longprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ExecutorServicecreateThreadPool(int min_threads, int max_threads, long keep_alive_time, String rejection_policy, BlockingQueue<Runnable> queue, ThreadFactory factory) voiddestroy()Called after an instance has been stopped.voidbooleanintgetDelta()booleanlongintintintintDeprecated.booleanintDeprecated.longintintvoidinit()Called after an instance has been created and before it is started.booleanbooleanlongpool()voidvoidDeprecated.setDelta(int d) setIncreaseMaxSizeDynamically(boolean b) setKeepAliveTime(long time) setMaxThreads(int size) setMinThreads(int size) voidsetRejectionPolicy(String policy) setThreadDumpsEnabled(boolean b) setThreadDumpsThreshold(int t) Deprecated.setThreadFactory(ThreadFactory factory) setThreadPool(Executor thread_pool) setThreadPoolFullSuppressTime(long t) toString()booleanuseVirtualThreads(boolean b)
-
Field Details
-
thread_pool
-
log
-
thread_factory
-
address
-
thread_pool_full_log
-
enabled
protected boolean enabled -
use_virtual_threads
protected boolean use_virtual_threads -
min_threads
protected int min_threads -
max_threads
protected int max_threads -
keep_alive_time
protected long keep_alive_time -
rejection_policy
-
thread_pool_full_suppress_time
protected long thread_pool_full_suppress_time -
thread_dumps_threshold
Deprecated. -
thread_dump_path
Deprecated. -
thread_dumps_enabled
protected boolean thread_dumps_enabled -
increase_max_size_dynamically
protected boolean increase_max_size_dynamically -
delta
protected int delta -
num_rejected_msgs
-
-
Constructor Details
-
ThreadPool
public ThreadPool()
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
getThreadPool
-
setThreadPool
-
setThreadFactory
-
getThreadFactory
-
isShutdown
public boolean isShutdown() -
getMinThreads
public int getMinThreads() -
setMinThreads
-
getMaxThreads
public int getMaxThreads() -
setMaxThreads
-
getKeepAliveTime
public long getKeepAliveTime() -
setKeepAliveTime
-
setRejectionPolicy
-
getRejectedExecutionHandler
-
setRejectedExecutionHandler
-
getThreadPoolFullSuppressTime
public long getThreadPoolFullSuppressTime() -
setThreadPoolFullSuppressTime
-
getThreadDumpsEnabled
public boolean getThreadDumpsEnabled() -
setThreadDumpsEnabled
-
getThreadDumpsThreshold
Deprecated. -
setThreadDumpsThreshold
Deprecated. -
getAddress
-
setAddress
-
getIncreaseMaxSizeDynamically
public boolean getIncreaseMaxSizeDynamically() -
setIncreaseMaxSizeDynamically
-
getDelta
public int getDelta() -
setDelta
-
numberOfRejectedMessages
public long numberOfRejectedMessages() -
log
-
useVirtualThreads
public boolean useVirtualThreads() -
useVirtualThreads
-
getNumberOfThreadDumps
Deprecated. -
resetThreadDumps
Deprecated. -
getThreadPoolSize
public int getThreadPoolSize() -
getThreadPoolSizeActive
public int getThreadPoolSizeActive() -
getLargestSize
public int getLargestSize() -
resetStats
public void resetStats() -
init
Description copied from interface:LifecycleCalled after an instance has been created and before it is started. -
destroy
public void destroy()Description copied from interface:LifecycleCalled after an instance has been stopped. Cleans up resources -
removeExpired
-
doExecute
-
pool
-
execute
-
toString
-
createThreadPool
protected static ExecutorService createThreadPool(int min_threads, int max_threads, long keep_alive_time, String rejection_policy, BlockingQueue<Runnable> queue, ThreadFactory factory)
-