Class JavaThreadPoolFeature
java.lang.Object
ch.raffael.meldioc.library.base.threading.AbstractThreadingFeature
ch.raffael.meldioc.library.base.threading.AbstractThreadingFeature.WithTaskAdvice
ch.raffael.meldioc.library.base.threading.JavaThreadPoolFeature
- All Implemented Interfaces:
TaskAdviceFeature,ThreadingFeature
- Direct Known Subclasses:
JavaThreadPoolFeature.WithShutdown
@Feature
@Prefix("workers")
public abstract class JavaThreadPoolFeature
extends AbstractThreadingFeature.WithTaskAdvice
A
ThreadingFeature that uses a Java ThreadPoolExecutor.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJavaThreadPoolFeature.WithShutdownAJavaThreadPoolFeaturethat destroys the thread pool on finalizing the shutdown.Nested classes/interfaces inherited from class ch.raffael.meldioc.library.base.threading.AbstractThreadingFeature
AbstractThreadingFeature.WithTaskAdviceNested classes/interfaces inherited from interface ch.raffael.meldioc.library.base.threading.TaskAdviceFeature
TaskAdviceFeature.ProfileNested classes/interfaces inherited from interface ch.raffael.meldioc.library.base.threading.ThreadingFeature
ThreadingFeature.Util, ThreadingFeature.WithSystemForkJoinPool -
Field Summary
Fields inherited from class ch.raffael.meldioc.library.base.threading.AbstractThreadingFeature
workExecutorProvider -
Constructor Summary
Constructors Constructor Description JavaThreadPoolFeature() -
Method Summary
Modifier and Type Method Description protected intcorePoolSize()protected java.util.concurrent.BlockingQueue<java.lang.Runnable>createQueue()protected io.vavr.control.Option<? extends java.util.concurrent.RejectedExecutionHandler>createRejectedExecutionHandler()protected java.util.concurrent.ThreadFactorycreateThreadFactory()protected java.time.DurationkeepAliveTime()protected intmaxPoolSize()protected intqueueCapacity()protected io.vavr.control.Option<java.lang.ThreadGroup>threadGroup()protected java.util.concurrent.ExecutorServiceworkExecutorImplementation()Methods inherited from class ch.raffael.meldioc.library.base.threading.AbstractThreadingFeature.WithTaskAdvice
taskAdvice, taskAdviceProfileMethods inherited from class ch.raffael.meldioc.library.base.threading.AbstractThreadingFeature
unrestrictedWorkExecutor, workExecutorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.raffael.meldioc.library.base.threading.ThreadingFeature
forkJoinPool
-
Constructor Details
-
JavaThreadPoolFeature
public JavaThreadPoolFeature()
-
-
Method Details
-
corePoolSize
@Parameter protected int corePoolSize() -
maxPoolSize
@Parameter protected int maxPoolSize() -
keepAliveTime
@Parameter protected java.time.Duration keepAliveTime() -
queueCapacity
@Parameter protected int queueCapacity() -
workExecutorImplementation
@Provision(singleton=true) protected java.util.concurrent.ExecutorService workExecutorImplementation()- Overrides:
workExecutorImplementationin classAbstractThreadingFeature
-
createQueue
protected java.util.concurrent.BlockingQueue<java.lang.Runnable> createQueue() -
createThreadFactory
protected java.util.concurrent.ThreadFactory createThreadFactory() -
threadGroup
protected io.vavr.control.Option<java.lang.ThreadGroup> threadGroup() -
createRejectedExecutionHandler
protected io.vavr.control.Option<? extends java.util.concurrent.RejectedExecutionHandler> createRejectedExecutionHandler()
-