Class DefaultAsyncTaskExecutor
- java.lang.Object
-
- org.flowable.common.engine.impl.async.DefaultAsyncTaskExecutor
-
- All Implemented Interfaces:
AsyncTaskExecutor
public class DefaultAsyncTaskExecutor extends Object implements AsyncTaskExecutor
- Author:
- Joram Barrez, Tijs Rademakers, Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description protected AsyncTaskExecutorConfigurationconfigurationprotected booleanexecutorNeedsShutdownWhether the executor needs a shutdown.protected ExecutorServiceexecutorServiceThe executor service used for task execution.protected org.slf4j.Loggerloggerprotected RejectedExecutionHandlerrejectedExecutionHandlerprotected ThreadFactorythreadFactoryprotected BlockingQueue<Runnable>threadPoolQueueThe queue used for job execution work
-
Constructor Summary
Constructors Constructor Description DefaultAsyncTaskExecutor()DefaultAsyncTaskExecutor(AsyncTaskExecutorConfiguration configuration)
-
Method Summary
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
configuration
protected final AsyncTaskExecutorConfiguration configuration
-
executorService
protected ExecutorService executorService
The executor service used for task execution.
-
executorNeedsShutdown
protected boolean executorNeedsShutdown
Whether the executor needs a shutdown. This is true if the executor service has not been set from the outside.
-
threadPoolQueue
protected BlockingQueue<Runnable> threadPoolQueue
The queue used for job execution work
-
threadFactory
protected ThreadFactory threadFactory
-
rejectedExecutionHandler
protected RejectedExecutionHandler rejectedExecutionHandler
-
-
Constructor Detail
-
DefaultAsyncTaskExecutor
public DefaultAsyncTaskExecutor()
-
DefaultAsyncTaskExecutor
public DefaultAsyncTaskExecutor(AsyncTaskExecutorConfiguration configuration)
-
-
Method Detail
-
execute
public void execute(Runnable task)
- Specified by:
executein interfaceAsyncTaskExecutor
-
submit
public CompletableFuture<?> submit(Runnable task)
- Specified by:
submitin interfaceAsyncTaskExecutor
-
submit
public <T> CompletableFuture<T> submit(Callable<T> task)
- Specified by:
submitin interfaceAsyncTaskExecutor
-
start
public void start()
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceAsyncTaskExecutor
-
initializeExecutor
protected ExecutorService initializeExecutor()
-
getConfiguration
public AsyncTaskExecutorConfiguration getConfiguration()
-
getCorePoolSize
public int getCorePoolSize()
-
setCorePoolSize
public void setCorePoolSize(int corePoolSize)
-
getMaxPoolSize
public int getMaxPoolSize()
-
setMaxPoolSize
public void setMaxPoolSize(int maxPoolSize)
-
getKeepAliveTime
public long getKeepAliveTime()
-
setKeepAliveTime
public void setKeepAliveTime(long keepAliveTime)
-
getQueueSize
public int getQueueSize()
-
setQueueSize
public void setQueueSize(int queueSize)
-
isAllowCoreThreadTimeout
public boolean isAllowCoreThreadTimeout()
-
setAllowCoreThreadTimeout
public void setAllowCoreThreadTimeout(boolean allowCoreThreadTimeout)
-
getSecondsToWaitOnShutdown
public long getSecondsToWaitOnShutdown()
-
setSecondsToWaitOnShutdown
public void setSecondsToWaitOnShutdown(long secondsToWaitOnShutdown)
-
getThreadPoolQueue
public BlockingQueue<Runnable> getThreadPoolQueue()
-
setThreadPoolQueue
public void setThreadPoolQueue(BlockingQueue<Runnable> threadPoolQueue)
-
getThreadPoolNamingPattern
public String getThreadPoolNamingPattern()
-
setThreadPoolNamingPattern
public void setThreadPoolNamingPattern(String threadPoolNamingPattern)
-
getThreadFactory
public ThreadFactory getThreadFactory()
-
setThreadFactory
public void setThreadFactory(ThreadFactory threadFactory)
-
getRejectedExecutionHandler
public RejectedExecutionHandler getRejectedExecutionHandler()
-
setRejectedExecutionHandler
public void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
-
getRemainingCapacity
public int getRemainingCapacity()
- Specified by:
getRemainingCapacityin interfaceAsyncTaskExecutor
-
-