org.gridgain.grid.test
Class GridTestExecutorService
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.gridgain.grid.test.GridTestExecutorService
- All Implemented Interfaces:
- Executor, ExecutorService
public class GridTestExecutorService
- extends ThreadPoolExecutor
Special ExecutorService executor service to be used for JUnit execution.
This executor service is specified by default in $GRIDGAIN_HOME/config/junit/junit-spring.xml.
Every thread created and used within this executor service will belong to its own
ThreadGroup instance that is different from all other threads. This way all threads
spawned by a single unit test will belong to the same thread group. This feature is
used for logging to be able to group log statements from different threads for individual
tests.
-
| 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 |
DFLT_CORE_POOL_SIZE
public static final int DFLT_CORE_POOL_SIZE
- Default core pool size (value is
100).
- See Also:
- Constant Field Values
GridTestExecutorService
public GridTestExecutorService(String gridName)
- Creates a new service with default initial parameters. Each created thread will
belong to its own group.
Default values are:
- Parameters:
gridName - Name of the grid.
GridTestExecutorService
public GridTestExecutorService(String gridName,
int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQueue)
- Creates a new service with the given initial parameters. Each created thread
will belong to its own group.
- Parameters:
corePoolSize - The number of threads to keep in the pool, even if they are idle.maxPoolSize - The maximum number of threads to allow in the pool.keepAliveTime - When the number of threads is greater than the core, this is the maximum time
that excess idle threads will wait for new tasks before terminating.workQueue - The queue to use for holding tasks before they are executed. This queue will hold only
runnable tasks submitted by the ThreadPoolExecutor.execute(Runnable) method.gridName - Name of the grid.
GridTestExecutorService
public GridTestExecutorService(String gridName,
int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQueue,
RejectedExecutionHandler handler)
- Creates a new service with the given initial parameters. Each created thread will
belong to its own group.
- Parameters:
corePoolSize - The number of threads to keep in the pool, even if they are idle.maxPoolSize - The maximum number of threads to allow in the pool.keepAliveTime - When the number of threads is greater than the core, this is the maximum time
that excess idle threads will wait for new tasks before terminating.workQueue - The queue to use for holding tasks before they are executed. This queue will hold only the
runnable tasks submitted by the ThreadPoolExecutor.execute(Runnable) method.handler - The handler to use when execution is blocked because the thread bounds and queue
capacities are reached.gridName - Name of the grid.