Class ThreadPool
java.lang.Object
org.jgroups.util.ThreadPool
- All Implemented Interfaces:
Lifecycle
Thread pool based on
ThreadPoolExecutor- Since:
- 5.2
- Author:
- Bela Ban
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Addressprotected intprotected booleanprotected booleanprotected longprotected Logprotected intprotected intprotected final LongAdderprotected final RejectedExecutionHandlerprotected Stringprotected StringDeprecated.protected booleanprotected intDeprecated.protected ThreadFactoryprotected Executorprotected SuppressLog<String> protected long -
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, Log log) voiddestroy()Called after an instance has been stopped.voidbooleanbooleanexecute(Runnable task, RejectedExecutionHandler h) intgetDelta()booleanlongintintintprotected static MethodHandlebooleanlongintintvoidinit()Called after an instance has been created and before it is started.booleanbooleanprotected static ExecutorServicenewVirtualThreadPool(ThreadFactory factory) longpool()voidsetDelta(int d) setIncreaseMaxSizeDynamically(boolean b) setKeepAliveTime(long time) setMaxThreads(int size) setMinThreads(int size) voidsetRejectionPolicy(String policy) setThreadDumpsEnabled(boolean b) setThreadFactory(ThreadFactory factory) setThreadPool(Executor thread_pool) setThreadPoolFullSuppressTime(long t) toString()
-
Field Details
-
thread_pool
-
log
-
thread_factory
-
address
-
thread_pool_full_log
-
enabled
protected boolean enabled -
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
-
rejected_handler
-
-
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
-
getAddress
-
setAddress
-
getIncreaseMaxSizeDynamically
public boolean getIncreaseMaxSizeDynamically() -
setIncreaseMaxSizeDynamically
-
getDelta
public int getDelta() -
setDelta
-
numberOfRejectedMessages
public long numberOfRejectedMessages() -
log
-
getThreadPoolSize
public int getThreadPoolSize() -
getThreadPoolSizeActive
public int getThreadPoolSizeActive() -
getLargestSize
public int getLargestSize() -
resetStats
public void resetStats() -
init
-
destroy
-
removeExpired
-
doExecute
-
pool
-
execute
-
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, Log log) -
newVirtualThreadPool
-
getNewThreadPerTaskExecutorHandle
-