@ClientAsyncExecutor class DefaultClientAsyncExecutorProvider extends ThreadPoolExecutorProvider
ExecutorServiceProvider
used on the client side for asynchronous request processing.Modifier and Type | Field and Description |
---|---|
private LazyValue<java.lang.Integer> |
asyncThreadPoolSize |
private static java.util.logging.Logger |
LOGGER |
DEFAULT_TERMINATION_TIMEOUT
Constructor and Description |
---|
DefaultClientAsyncExecutorProvider(int poolSize)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getCorePoolSize()
Get the number of the core threads of the the provisioned thread pool executor.
|
protected int |
getMaximumPoolSize()
Get the maximum number of threads to allow in the thread pool.
|
createExecutor, createExecutor, dispose, getExecutorService, getKeepAliveTime, getWorkQueue, preDestroy
close, getBackingThreadFactory, getExecutor, getRejectedExecutionHandler, getTerminationTimeout, isClosed, onClose
private static final java.util.logging.Logger LOGGER
private final LazyValue<java.lang.Integer> asyncThreadPoolSize
@Inject public DefaultClientAsyncExecutorProvider(@Named(value="ClientAsyncThreadPoolSize") int poolSize)
poolSize
- size of the default executor thread pool (if used). Zero or negative values are ignored.
See also ClientProperties.ASYNC_THREADPOOL_SIZE
.protected int getMaximumPoolSize()
ThreadPoolExecutorProvider
The value from this method is passed as one of the input parameters in a call to the
ThreadPoolExecutorProvider.createExecutor(int, int, long, java.util.concurrent.BlockingQueue, java.util.concurrent.ThreadFactory,
java.util.concurrent.RejectedExecutionHandler)
method.
The method can be overridden to customize the maximum number of threads allowed in the provisioned thread pool executor.
If not customized, the method defaults to Integer.MAX_VALUE
.
getMaximumPoolSize
in class ThreadPoolExecutorProvider
protected int getCorePoolSize()
AbstractThreadPoolProvider
The value from this method is passed as one of the input parameters in a call to the AbstractThreadPoolProvider.createExecutor(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler)
method.
The method can be overridden to customize the number of core threads of the provisioned thread pool executor.
If not customized, the method defaults to the number of available processors
in the system.
getCorePoolSize
in class AbstractThreadPoolProvider<java.util.concurrent.ThreadPoolExecutor>
AbstractThreadPoolProvider.createExecutor(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler)