public class DefaultExecutorFactory extends Object implements ExecutorFactory
| Constructor and Description |
|---|
DefaultExecutorFactory() |
| Modifier and Type | Method and Description |
|---|---|
ExecutorService |
createCoreExecutor(int size)
Create an executor service of the given size
This executor may have a small core pool size and, if possible, should not be queued
|
ExecutorService |
createExecutor(int coreSize,
int size)
similar to
ExecutorFactory.createCoreExecutor(int) but creating an executor with unlimited (or large) queue size
with defined core pool size |
ScheduledExecutorService |
createTimeoutExecutor(int size)
create a scheduled executor service for handling timeouts
|
int |
priority()
priority of this factory.
|
protected ThreadFactory |
threadFactory()
Can be overridden in a subclass to provide a different
ThreadFactory. |
public ExecutorService createCoreExecutor(int size)
ExecutorFactorycreateCoreExecutor in interface ExecutorFactorysize - amount of threads in the poolpublic ExecutorService createExecutor(int coreSize, int size)
ExecutorFactoryExecutorFactory.createCoreExecutor(int) but creating an executor with unlimited (or large) queue size
with defined core pool sizecreateExecutor in interface ExecutorFactorycoreSize - amount of threads in the pool's coresize - amount of threads in the poolpublic ScheduledExecutorService createTimeoutExecutor(int size)
ExecutorFactorycreateTimeoutExecutor in interface ExecutorFactorysize - the amount of threads in the poolprotected ThreadFactory threadFactory()
ThreadFactory.
Useful e.g. in a Jakarta EE container, where the threads must be managed.public int priority()
ExecutorFactorypriority in interface ExecutorFactoryCopyright © 2018–2020. All rights reserved.