Package com.yahoo.container.handler
Class ThreadPoolProvider
java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.container.handler.ThreadPoolProvider
- All Implemented Interfaces:
com.yahoo.component.Component
,com.yahoo.component.Deconstructable
,com.yahoo.container.di.componentgraph.Provider<Executor>
,Comparable<com.yahoo.component.Component>
public class ThreadPoolProvider
extends com.yahoo.component.AbstractComponent
implements com.yahoo.container.di.componentgraph.Provider<Executor>
A configurable thread pool provider for the jdisc default threadpool.
This provides the worker threads used for normal request processing.
Request an
Executor
injected in your component constructor if you want to use it.- Author:
- Steinar Knutsen, baldersheim, bratseth
-
Field Summary
Fields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable
-
Constructor Summary
ConstructorDescriptionThreadPoolProvider
(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric) ThreadPoolProvider
(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric, ProcessTerminator processTerminator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Shut down the thread pool, give a grace period of 1 second before forcibly shutting down all worker threads.get()
Get the Executor provided by this class.Methods inherited from class com.yahoo.component.AbstractComponent
clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
Constructor Details
-
ThreadPoolProvider
-
ThreadPoolProvider
public ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric, ProcessTerminator processTerminator)
-
-
Method Details
-
get
Get the Executor provided by this class. This Executor will by default also be used for search queries and processing requests.- Specified by:
get
in interfacecom.yahoo.container.di.componentgraph.Provider<Executor>
- Returns:
- a possibly shared executor
-
deconstruct
public void deconstruct()Shut down the thread pool, give a grace period of 1 second before forcibly shutting down all worker threads.- Specified by:
deconstruct
in interfacecom.yahoo.component.Deconstructable
- Overrides:
deconstruct
in classcom.yahoo.component.AbstractComponent
-