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<java.util.concurrent.Executor>
,java.lang.Comparable<com.yahoo.component.Component>
public class ThreadPoolProvider extends com.yahoo.component.AbstractComponent implements com.yahoo.container.di.componentgraph.Provider<java.util.concurrent.Executor>
A configurable thread pool provider. 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
-
-
Constructor Summary
Constructors Constructor Description ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric)
ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric, ProcessTerminator processTerminator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deconstruct()
Shut down the thread pool, give a grace period of 1 second before forcibly shutting down all worker threads.java.util.concurrent.Executor
get()
Get the Executor provided by this class.
-
-
-
Constructor Detail
-
ThreadPoolProvider
@Inject public ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric)
-
ThreadPoolProvider
public ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric, ProcessTerminator processTerminator)
-
-
Method Detail
-
get
public java.util.concurrent.Executor 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<java.util.concurrent.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
-
-