java.util.concurrent.Executor, LifeCycle, ThreadPool, ThreadPool.SizedThreadPoolpublic class ExecutorSizedThreadPool extends AbstractLifeCycle implements ThreadPool.SizedThreadPool
ThreadPool.SizedThreadPool wrapper around ThreadPoolExecutor.AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerThreadPool.SizedThreadPoolFAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor | Description |
|---|---|
ExecutorSizedThreadPool() |
|
ExecutorSizedThreadPool(java.util.concurrent.ThreadPoolExecutor executor) |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
doStop() |
|
void |
execute(java.lang.Runnable command) |
|
int |
getIdleThreads() |
|
int |
getMaxThreads() |
|
int |
getMinThreads() |
|
ThreadPoolBudget |
getThreadPoolBudget() |
|
int |
getThreads() |
|
boolean |
isLowOnThreads() |
|
void |
join() |
Blocks until the thread pool is
stopped. |
void |
setMaxThreads(int threads) |
|
void |
setMinThreads(int threads) |
addLifeCycleListener, doStart, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stoppublic ExecutorSizedThreadPool()
public ExecutorSizedThreadPool(java.util.concurrent.ThreadPoolExecutor executor)
public int getMinThreads()
getMinThreads in interface ThreadPool.SizedThreadPoolpublic int getMaxThreads()
getMaxThreads in interface ThreadPool.SizedThreadPoolpublic void setMinThreads(int threads)
setMinThreads in interface ThreadPool.SizedThreadPoolthreads - the minimum number of threadspublic void setMaxThreads(int threads)
setMaxThreads in interface ThreadPool.SizedThreadPoolthreads - the maximum number of threadspublic int getThreads()
getThreads in interface ThreadPoolpublic int getIdleThreads()
getIdleThreads in interface ThreadPoolpublic void execute(java.lang.Runnable command)
execute in interface java.util.concurrent.Executorpublic boolean isLowOnThreads()
isLowOnThreads in interface ThreadPoolprotected void doStop()
throws java.lang.Exception
doStop in class AbstractLifeCyclejava.lang.Exceptionpublic void join()
throws java.lang.InterruptedException
ThreadPoolstopped.join in interface ThreadPooljava.lang.InterruptedException - if thread was interruptedpublic ThreadPoolBudget getThreadPoolBudget()
getThreadPoolBudget in interface ThreadPool.SizedThreadPoolCopyright © 1995–2017 Webtide. All rights reserved.