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.StringNUMBER_OF_WORKS_EXECUTEDstatic java.lang.StringNUMBER_OF_WORKS_PENDINGstatic java.lang.StringNUMBER_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 voidclearAllQueues()clear the queue of workvoidshutdownAndEmptyQueue()shutdown and handle the queue properlyjava.util.concurrent.Future<?>submit(java.lang.Runnable task)voidsubmit(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:BonitaExecutorServiceclear the queue of work- Specified by:
clearAllQueuesin interfaceBonitaExecutorService
-
submit
public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
- Specified by:
submitin interfacejava.util.concurrent.ExecutorService- Overrides:
submitin classjava.util.concurrent.AbstractExecutorService
-
shutdownAndEmptyQueue
public void shutdownAndEmptyQueue()
Description copied from interface:BonitaExecutorServiceshutdown and handle the queue properly- Specified by:
shutdownAndEmptyQueuein interfaceBonitaExecutorService
-
submit
public void submit(WorkDescriptor work)
Description copied from interface:BonitaExecutorServiceExecute the work described by the work descriptor- Specified by:
submitin interfaceBonitaExecutorService
-
-