Package org.testng.internal.thread.graph
Class GraphThreadPoolExecutor<T>
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.testng.internal.thread.graph.GraphThreadPoolExecutor<T>
- All Implemented Interfaces:
AutoCloseable
,Executor
,ExecutorService
,ITestNGThreadPoolExecutor
public class GraphThreadPoolExecutor<T>
extends ThreadPoolExecutor
implements ITestNGThreadPoolExecutor
An Executor that launches tasks per batches. It takes a
DynamicGraph
of tasks to be run
and a IThreadWorkerFactory
to initialize/create Runnable
wrappers around those
tasks-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
Constructor Summary
ConstructorsConstructorDescriptionGraphThreadPoolExecutor
(String name, IDynamicGraph<T> graph, IThreadWorkerFactory<T> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Comparator<T> comparator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterExecute
(Runnable r, Throwable t) void
run()
Helps kick start the execution and is the point of entry for execution.Methods inherited from class java.util.concurrent.ThreadPoolExecutor
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, submit
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, close, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
Constructor Details
-
GraphThreadPoolExecutor
public GraphThreadPoolExecutor(String name, IDynamicGraph<T> graph, IThreadWorkerFactory<T> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Comparator<T> comparator)
-
-
Method Details
-
run
public void run()Description copied from interface:ITestNGThreadPoolExecutor
Helps kick start the execution and is the point of entry for execution.- Specified by:
run
in interfaceITestNGThreadPoolExecutor
-
afterExecute
- Overrides:
afterExecute
in classThreadPoolExecutor
-