public class LimitThreadPool extends ThreadPoolExecutor
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LimitThreadPool.BlockUntilFree |
protected static class |
LimitThreadPool.SafetyCheck |
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
LimitThreadPool(int maxThreadCount) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
active()
downloader working if here any "getTasks() more than 0"
|
protected void |
afterExecute(Runnable r,
Throwable t) |
protected void |
beforeExecute(Thread t,
Runnable r) |
void |
blockExecute(Runnable command) |
void |
close()
close and wait for threads to exit.
|
void |
execute(Runnable command)
You should not call this method on this Limited Version Thread Pool.
|
void |
interrupt()
Interrupt all child threads.
|
void |
join()
wait for all child threads to exit.
|
void |
waitUntilNextTaskEnds()
Wait until current task ends.
|
void |
waitUntilTermination()
Wait until thread pool execute its last task.
|
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitprotected void beforeExecute(Thread t, Runnable r)
beforeExecute in class ThreadPoolExecutorprotected void afterExecute(Runnable r, Throwable t)
afterExecute in class ThreadPoolExecutorpublic boolean active()
public void waitUntilNextTaskEnds()
throws InterruptedException
InterruptedExceptionpublic void waitUntilTermination()
throws InterruptedException
InterruptedExceptionpublic void execute(Runnable command)
execute in interface Executorexecute in class ThreadPoolExecutorpublic void blockExecute(Runnable command) throws InterruptedException
InterruptedExceptionpublic void interrupt()
public void join()
throws InterruptedException
InterruptedExceptionpublic void close()
throws InterruptedException
InterruptedExceptionCopyright © 2016. All Rights Reserved.