Class DefaultClientAsyncExecutorProvider
- All Implemented Interfaces:
AutoCloseable
,ExecutorServiceProvider
ExecutorServiceProvider
used on the client side for asynchronous request processing.-
Field Summary
FieldsFields inherited from class org.glassfish.jersey.spi.AbstractThreadPoolProvider
DEFAULT_TERMINATION_TIMEOUT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Get the number of the core threads of the the provisioned thread pool executor.protected int
Get the maximum number of threads to allow in the thread pool.Methods inherited from class org.glassfish.jersey.spi.ThreadPoolExecutorProvider
createExecutor, createExecutor, dispose, getExecutorService, getKeepAliveTime, getWorkQueue, preDestroy
Methods inherited from class org.glassfish.jersey.spi.AbstractThreadPoolProvider
close, getBackingThreadFactory, getExecutor, getRejectedExecutionHandler, getTerminationTimeout, isClosed, onClose
-
Field Details
-
LOGGER
-
asyncThreadPoolSize
-
-
Constructor Details
-
DefaultClientAsyncExecutorProvider
@Inject public DefaultClientAsyncExecutorProvider(@Named("ClientAsyncThreadPoolSize") int poolSize) Creates a new instance.- Parameters:
poolSize
- size of the default executor thread pool (if used). Zero or negative values are ignored. See alsoClientProperties.ASYNC_THREADPOOL_SIZE
.
-
-
Method Details
-
getMaximumPoolSize
protected int getMaximumPoolSize()Description copied from class:ThreadPoolExecutorProvider
Get the maximum number of threads to allow in the thread pool.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
.- Overrides:
getMaximumPoolSize
in classThreadPoolExecutorProvider
- Returns:
- maximum number of threads allowed in the thread pool.
-
getCorePoolSize
protected int getCorePoolSize()Description copied from class:AbstractThreadPoolProvider
Get the number of the core threads of the the provisioned thread pool executor.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.- Overrides:
getCorePoolSize
in classAbstractThreadPoolProvider<ThreadPoolExecutor>
- Returns:
- number of core threads in the provisioned thread pool executor.
- See Also:
-