public final class QueuableCachedThreadPool extends ThreadPoolExecutor
| Modifier and Type | Class and Description |
|---|---|
protected static class |
QueuableCachedThreadPool.ControllableQueue
https://github.com/apache/tomcat/blob/trunk/java/org/apache/tomcat/util/threads/TaskQueue.java
|
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
QueuableCachedThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
QueuableCachedThreadPool.ControllableQueue workQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterExecute(Runnable r,
Throwable t) |
void |
execute(Runnable command) |
void |
execute(Runnable command,
long timeout,
TimeUnit unit)
Executes the given command at some time in the future.
|
int |
getSubmittedCount() |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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, submitpublic QueuableCachedThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
QueuableCachedThreadPool.ControllableQueue workQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler handler)
protected void afterExecute(Runnable r, Throwable t)
afterExecute in class ThreadPoolExecutorpublic int getSubmittedCount()
public void execute(Runnable command)
execute in interface Executorexecute in class ThreadPoolExecutorpublic void execute(Runnable command, long timeout, TimeUnit unit)
command - the runnable tasktimeout - A timeout for the completion of the taskunit - The timeout time unitRejectedExecutionException - if this task cannot be accepted for execution - the queue is fullNullPointerException - if command or unit is nullCopyright © 2018. All rights reserved.