Class ThreadPoolExecutorFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean
org.apache.mina.integration.spring.ThreadPoolExecutorFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean
,org.springframework.beans.factory.InitializingBean
public class ThreadPoolExecutorFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean
Spring
FactoryBean
which enables the configuration of
ThreadPoolExecutor
instances using Spring. Most of this code
has been copied from the ThreadPoolTaskExecutor
class
available in Spring 2.0.-
Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
protected void
void
setCorePoolSize
(int corePoolSize) Set the ThreadPoolExecutor's core pool size.void
setKeepAliveSeconds
(int keepAliveSeconds) Set the ThreadPoolExecutor's keep alive seconds.void
setMaxPoolSize
(int maxPoolSize) Set the ThreadPoolExecutor's maximum pool size.void
setQueueCapacity
(int queueCapacity) Set the capacity for the ThreadPoolExecutor's BlockingQueue.void
setRejectedExecutionHandler
(RejectedExecutionHandler rejectedExecutionHandler) Set the RejectedExecutionHandler to use for the ThreadPoolExecutor.void
setThreadFactory
(ThreadFactory threadFactory) Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool.Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
ThreadPoolExecutorFactoryBean
public ThreadPoolExecutorFactoryBean()
-
-
Method Details
-
setCorePoolSize
public void setCorePoolSize(int corePoolSize) Set the ThreadPoolExecutor's core pool size. Default is 1. -
setMaxPoolSize
public void setMaxPoolSize(int maxPoolSize) Set the ThreadPoolExecutor's maximum pool size. Default isInteger.MAX_VALUE
. -
setKeepAliveSeconds
public void setKeepAliveSeconds(int keepAliveSeconds) Set the ThreadPoolExecutor's keep alive seconds. Default is 60. -
setQueueCapacity
public void setQueueCapacity(int queueCapacity) Set the capacity for the ThreadPoolExecutor's BlockingQueue. Default isInteger.MAX_VALUE
.Any positive value will lead to a LinkedBlockingQueue instance; any other value will lead to a SynchronousQueue instance.
- See Also:
-
setThreadFactory
Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool. Default is the ThreadPoolExecutor's default thread factory.- See Also:
-
setRejectedExecutionHandler
Set the RejectedExecutionHandler to use for the ThreadPoolExecutor. Default is the ThreadPoolExecutor's default abort policy.- See Also:
-
createInstance
- Specified by:
createInstance
in classorg.springframework.beans.factory.config.AbstractFactoryBean
- Throws:
Exception
-
destroyInstance
- Overrides:
destroyInstance
in classorg.springframework.beans.factory.config.AbstractFactoryBean
- Throws:
Exception
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean
- Specified by:
getObjectType
in classorg.springframework.beans.factory.config.AbstractFactoryBean
-