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 of ThreadPool using flexible number of threads wraps ExecutorService.
  • 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

      public ExecutorService getExecutor()
      Specified by:
      getExecutor in interface ThreadPool
    • getMinThreadCount

      public int getMinThreadCount()
    • setMinThreadCount

      public void setMinThreadCount(int minThreadCount)
    • getMaxThreadCount

      public int getMaxThreadCount()
      Specified by:
      getMaxThreadCount in interface ThreadPool
    • 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:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable