Class FlexibleThreadPoolWrapper
java.lang.Object
org.opendaylight.controller.config.threadpool.util.FlexibleThreadPoolWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable,org.opendaylight.controller.config.threadpool.ThreadPool
public class FlexibleThreadPoolWrapper
extends Object
implements org.opendaylight.controller.config.threadpool.ThreadPool, Closeable
Implementation of
ThreadPool using flexible number of threads wraps
ExecutorService.-
Constructor Summary
ConstructorsConstructorDescriptionFlexibleThreadPoolWrapper(int minThreadCount, int maxThreadCount, long keepAlive, TimeUnit timeUnit, ThreadFactory threadFactory) FlexibleThreadPoolWrapper(int minThreadCount, int maxThreadCount, long keepAlive, TimeUnit timeUnit, ThreadFactory threadFactory, OptionalInt queueCapacity) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longintintvoidvoidsetKeepAliveMillis(long keepAliveMillis) voidsetMaxThreadCount(int maxThreadCount) voidsetMinThreadCount(int minThreadCount) voidsetThreadFactory(ThreadFactory threadFactory)
-
Constructor Details
-
FlexibleThreadPoolWrapper
public FlexibleThreadPoolWrapper(int minThreadCount, int maxThreadCount, long keepAlive, TimeUnit timeUnit, ThreadFactory threadFactory) -
FlexibleThreadPoolWrapper
public FlexibleThreadPoolWrapper(int minThreadCount, int maxThreadCount, long keepAlive, TimeUnit timeUnit, ThreadFactory threadFactory, OptionalInt queueCapacity)
-
-
Method Details
-
getExecutor
- Specified by:
getExecutorin interfaceorg.opendaylight.controller.config.threadpool.ThreadPool
-
getMinThreadCount
public int getMinThreadCount() -
setMinThreadCount
public void setMinThreadCount(int minThreadCount) -
getMaxThreadCount
public int getMaxThreadCount()- Specified by:
getMaxThreadCountin interfaceorg.opendaylight.controller.config.threadpool.ThreadPool
-
setMaxThreadCount
public void setMaxThreadCount(int maxThreadCount) -
getKeepAliveMillis
public long getKeepAliveMillis() -
setKeepAliveMillis
public void setKeepAliveMillis(long keepAliveMillis) -
setThreadFactory
-
prestartAllCoreThreads
public void prestartAllCoreThreads() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-