Class DefaultClientAsyncExecutorProvider
- java.lang.Object
-
- org.glassfish.jersey.spi.AbstractThreadPoolProvider<java.util.concurrent.ThreadPoolExecutor>
-
- org.glassfish.jersey.spi.ThreadPoolExecutorProvider
-
- org.glassfish.jersey.client.DefaultClientAsyncExecutorProvider
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,ExecutorServiceProvider
@ClientAsyncExecutor class DefaultClientAsyncExecutorProvider extends ThreadPoolExecutorProvider
DefaultExecutorServiceProvider
used on the client side for asynchronous request processing.
-
-
Field Summary
Fields Modifier and Type Field Description private LazyValue<java.lang.Integer>
asyncThreadPoolSize
private static java.util.logging.Logger
LOGGER
-
Fields inherited from class org.glassfish.jersey.spi.AbstractThreadPoolProvider
DEFAULT_TERMINATION_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description DefaultClientAsyncExecutorProvider(int poolSize)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
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 Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
asyncThreadPoolSize
private final LazyValue<java.lang.Integer> asyncThreadPoolSize
-
-
Constructor Detail
-
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 Detail
-
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<java.util.concurrent.ThreadPoolExecutor>
- Returns:
- number of core threads in the provisioned thread pool executor.
- See Also:
AbstractThreadPoolProvider.createExecutor(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler)
-
-