public class DefaultAsyncTaskExecutor extends Object implements AsyncTaskExecutor
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowCoreThreadTimeout
Whether or not core threads can time out (which is needed to scale down the threads)
|
protected int |
corePoolSize
The minimal number of threads that are kept alive in the threadpool for
job execution
|
protected boolean |
executorNeedsShutdown
Whether the executor needs a shutdown.
|
protected ExecutorService |
executorService
The executor service used for task execution.
|
protected long |
keepAliveTime
The time (in milliseconds) a thread used for job execution must be kept
alive before it is destroyed.
|
protected org.slf4j.Logger |
logger |
protected int |
maxPoolSize
The maximum number of threads that are kept alive in the threadpool for
job execution
|
protected int |
queueSize
The size of the queue on which jobs to be executed are placed
|
protected RejectedExecutionHandler |
rejectedExecutionHandler |
protected long |
secondsToWaitOnShutdown
The time (in seconds) that is waited to gracefully shut down the
threadpool used for job execution
|
protected ThreadFactory |
threadFactory |
protected String |
threadPoolNamingPattern |
protected BlockingQueue<Runnable> |
threadPoolQueue
The queue used for job execution work
|
| Constructor and Description |
|---|
DefaultAsyncTaskExecutor() |
protected final org.slf4j.Logger logger
protected ExecutorService executorService
protected boolean executorNeedsShutdown
protected int corePoolSize
protected int maxPoolSize
protected long keepAliveTime
protected int queueSize
protected boolean allowCoreThreadTimeout
protected long secondsToWaitOnShutdown
protected BlockingQueue<Runnable> threadPoolQueue
protected String threadPoolNamingPattern
protected ThreadFactory threadFactory
protected RejectedExecutionHandler rejectedExecutionHandler
public void execute(Runnable task)
execute in interface AsyncTaskExecutorpublic CompletableFuture<?> submit(Runnable task)
submit in interface AsyncTaskExecutorpublic <T> CompletableFuture<T> submit(Callable<T> task)
submit in interface AsyncTaskExecutorpublic void start()
public void shutdown()
shutdown in interface AsyncTaskExecutorprotected ExecutorService initializeExecutor()
public int getCorePoolSize()
public void setCorePoolSize(int corePoolSize)
public int getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
public long getKeepAliveTime()
public void setKeepAliveTime(long keepAliveTime)
public int getQueueSize()
public void setQueueSize(int queueSize)
public boolean isAllowCoreThreadTimeout()
public void setAllowCoreThreadTimeout(boolean allowCoreThreadTimeout)
public long getSecondsToWaitOnShutdown()
public void setSecondsToWaitOnShutdown(long secondsToWaitOnShutdown)
public BlockingQueue<Runnable> getThreadPoolQueue()
public void setThreadPoolQueue(BlockingQueue<Runnable> threadPoolQueue)
public String getThreadPoolNamingPattern()
public void setThreadPoolNamingPattern(String threadPoolNamingPattern)
public ThreadFactory getThreadFactory()
public void setThreadFactory(ThreadFactory threadFactory)
public RejectedExecutionHandler getRejectedExecutionHandler()
public void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
public int getRemainingCapacity()
getRemainingCapacity in interface AsyncTaskExecutorCopyright © 2021 Flowable. All rights reserved.