public class FlexibleThreadPoolWrapper extends Object implements ThreadPool, Closeable
ThreadPool
using flexible number of threads wraps
ExecutorService
.Constructor and Description |
---|
FlexibleThreadPoolWrapper(int minThreadCount,
int maxThreadCount,
long keepAlive,
TimeUnit timeUnit,
ThreadFactory threadFactory) |
FlexibleThreadPoolWrapper(int minThreadCount,
int maxThreadCount,
long keepAlive,
TimeUnit timeUnit,
ThreadFactory threadFactory,
com.google.common.base.Optional<Integer> queueCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ExecutorService |
getExecutor() |
long |
getKeepAliveMillis() |
int |
getMaxThreadCount() |
int |
getMinThreadCount() |
void |
prestartAllCoreThreads() |
void |
setKeepAliveMillis(long keepAliveMillis) |
void |
setMaxThreadCount(int maxThreadCount) |
void |
setMinThreadCount(int minThreadCount) |
void |
setThreadFactory(ThreadFactory threadFactory) |
public FlexibleThreadPoolWrapper(int minThreadCount, int maxThreadCount, long keepAlive, TimeUnit timeUnit, ThreadFactory threadFactory)
public FlexibleThreadPoolWrapper(int minThreadCount, int maxThreadCount, long keepAlive, TimeUnit timeUnit, ThreadFactory threadFactory, com.google.common.base.Optional<Integer> queueCapacity)
public ExecutorService getExecutor()
getExecutor
in interface ThreadPool
public int getMinThreadCount()
public void setMinThreadCount(int minThreadCount)
public int getMaxThreadCount()
getMaxThreadCount
in interface ThreadPool
public void setMaxThreadCount(int maxThreadCount)
public long getKeepAliveMillis()
public void setKeepAliveMillis(long keepAliveMillis)
public void setThreadFactory(ThreadFactory threadFactory)
public void prestartAllCoreThreads()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2019 OpenDaylight. All rights reserved.