Class FlexibleThreadPoolWrapper
- java.lang.Object
-
- org.opendaylight.controller.config.threadpool.util.FlexibleThreadPoolWrapper
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ThreadPool
public class FlexibleThreadPoolWrapper extends Object implements ThreadPool, Closeable
Implementation ofThreadPoolusing flexible number of threads wrapsExecutorService.
-
-
Constructor Summary
Constructors Constructor Description FlexibleThreadPoolWrapper(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ExecutorServicegetExecutor()longgetKeepAliveMillis()intgetMaxThreadCount()intgetMinThreadCount()voidprestartAllCoreThreads()voidsetKeepAliveMillis(long keepAliveMillis)voidsetMaxThreadCount(int maxThreadCount)voidsetMinThreadCount(int minThreadCount)voidsetThreadFactory(ThreadFactory threadFactory)
-
-
-
Constructor Detail
-
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 Detail
-
getExecutor
public ExecutorService getExecutor()
- Specified by:
getExecutorin interfaceThreadPool
-
getMinThreadCount
public int getMinThreadCount()
-
setMinThreadCount
public void setMinThreadCount(int minThreadCount)
-
getMaxThreadCount
public int getMaxThreadCount()
- Specified by:
getMaxThreadCountin interfaceThreadPool
-
setMaxThreadCount
public void setMaxThreadCount(int maxThreadCount)
-
getKeepAliveMillis
public long getKeepAliveMillis()
-
setKeepAliveMillis
public void setKeepAliveMillis(long keepAliveMillis)
-
setThreadFactory
public void setThreadFactory(ThreadFactory threadFactory)
-
prestartAllCoreThreads
public void prestartAllCoreThreads()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-