public class DynamicallySizedThreadPoolExecutor
extends java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor which
behaves how one would expect it to, even when faced with an unlimited
queue. Unlike the default ThreadPoolExecutor, it
will add new Threads up to maximumPoolSize
when there is lots of pending work, rather than only when the queue is full
(which it often never will be, especially for unlimited queues)java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue) |
DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue,
java.util.concurrent.RejectedExecutionHandler handler) |
DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue,
java.util.concurrent.ThreadFactory threadFactory) |
DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.RejectedExecutionHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterExecute(java.lang.Runnable r,
java.lang.Throwable t) |
void |
execute(java.lang.Runnable command) |
void |
setCorePoolSize(int corePoolSize) |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringpublic DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue,
java.util.concurrent.RejectedExecutionHandler handler)
public DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.RejectedExecutionHandler handler)
public DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue,
java.util.concurrent.ThreadFactory threadFactory)
public DynamicallySizedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue workQueue)
public void setCorePoolSize(int corePoolSize)
setCorePoolSize in class java.util.concurrent.ThreadPoolExecutorpublic void execute(java.lang.Runnable command)
execute in interface java.util.concurrent.Executorexecute in class java.util.concurrent.ThreadPoolExecutorprotected void afterExecute(java.lang.Runnable r,
java.lang.Throwable t)
afterExecute in class java.util.concurrent.ThreadPoolExecutorCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.