Package org.bonitasoft.engine.work
Class BonitaThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- org.bonitasoft.engine.work.BonitaThreadPoolExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor
,java.util.concurrent.ExecutorService
,BonitaExecutorService
public class BonitaThreadPoolExecutor extends java.util.concurrent.ThreadPoolExecutor implements BonitaExecutorService
- Author:
- Julien Reboul, Baptiste Mesta
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NUMBER_OF_WORKS_EXECUTED
static java.lang.String
NUMBER_OF_WORKS_PENDING
static java.lang.String
NUMBER_OF_WORKS_RUNNING
-
Constructor Summary
Constructors Constructor Description BonitaThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler, WorkFactory workFactory, EngineClock engineClock, WorkExecutionCallback workExecutionCallback, WorkExecutionAuditor workExecutionAuditor, io.micrometer.core.instrument.MeterRegistry meterRegistry, long tenantId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAllQueues()
clear the queue of workvoid
shutdownAndEmptyQueue()
shutdown and handle the queue properlyjava.util.concurrent.Future<?>
submit(java.lang.Runnable task)
void
submit(WorkDescriptor work)
Execute the work described by the work descriptor-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.bonitasoft.engine.work.BonitaExecutorService
awaitTermination
-
-
-
-
Field Detail
-
NUMBER_OF_WORKS_PENDING
public static final java.lang.String NUMBER_OF_WORKS_PENDING
- See Also:
- Constant Field Values
-
NUMBER_OF_WORKS_RUNNING
public static final java.lang.String NUMBER_OF_WORKS_RUNNING
- See Also:
- Constant Field Values
-
NUMBER_OF_WORKS_EXECUTED
public static final java.lang.String NUMBER_OF_WORKS_EXECUTED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BonitaThreadPoolExecutor
public BonitaThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler, WorkFactory workFactory, EngineClock engineClock, WorkExecutionCallback workExecutionCallback, WorkExecutionAuditor workExecutionAuditor, io.micrometer.core.instrument.MeterRegistry meterRegistry, long tenantId)
-
-
Method Detail
-
clearAllQueues
public void clearAllQueues()
Description copied from interface:BonitaExecutorService
clear the queue of work- Specified by:
clearAllQueues
in interfaceBonitaExecutorService
-
submit
public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
- Specified by:
submit
in interfacejava.util.concurrent.ExecutorService
- Overrides:
submit
in classjava.util.concurrent.AbstractExecutorService
-
shutdownAndEmptyQueue
public void shutdownAndEmptyQueue()
Description copied from interface:BonitaExecutorService
shutdown and handle the queue properly- Specified by:
shutdownAndEmptyQueue
in interfaceBonitaExecutorService
-
submit
public void submit(WorkDescriptor work)
Description copied from interface:BonitaExecutorService
Execute the work described by the work descriptor- Specified by:
submit
in interfaceBonitaExecutorService
-
-