@Factory public class ExecutorFactory extends java.lang.Object
ExecutorService
instances based on UserExecutorConfiguration
instances.Constructor and Description |
---|
ExecutorFactory(BeanLocator beanLocator,
java.util.concurrent.ThreadFactory threadFactory) |
Modifier and Type | Method and Description |
---|---|
protected java.util.concurrent.ThreadFactory |
eventLoopGroupThreadFactory(ExecutorConfiguration configuration)
Constructs an executor thread factory.
|
java.util.concurrent.ExecutorService |
executorService(ExecutorConfiguration executorConfiguration)
Create the ExecutorService with the given configuration.
|
@Inject public ExecutorFactory(BeanLocator beanLocator, java.util.concurrent.ThreadFactory threadFactory)
beanLocator
- The bean beanLocatorthreadFactory
- The factory to create new threads@EachBean(value=ExecutorConfiguration.class) protected java.util.concurrent.ThreadFactory eventLoopGroupThreadFactory(ExecutorConfiguration configuration)
configuration
- The configuration@EachBean(value=ExecutorConfiguration.class) @Bean(preDestroy="shutdown") public java.util.concurrent.ExecutorService executorService(ExecutorConfiguration executorConfiguration)
executorConfiguration
- The configuration to create a thread pool that creates new threads as needed