public class DefaultThreadPool
extends EDU.oswego.cs.dl.util.concurrent.PooledExecutor
EDU.oswego.cs.dl.util.concurrent.PooledExecutor.AbortWhenBlocked, EDU.oswego.cs.dl.util.concurrent.PooledExecutor.BlockedExecutionHandler, EDU.oswego.cs.dl.util.concurrent.PooledExecutor.DiscardOldestWhenBlocked, EDU.oswego.cs.dl.util.concurrent.PooledExecutor.DiscardWhenBlocked, EDU.oswego.cs.dl.util.concurrent.PooledExecutor.RunWhenBlocked, EDU.oswego.cs.dl.util.concurrent.PooledExecutor.WaitWhenBlocked, EDU.oswego.cs.dl.util.concurrent.PooledExecutor.Worker
Constructor and Description |
---|
DefaultThreadPool(int poolSize,
boolean syncThreads)
Create a new pool.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the pool i.e, stop pooling threads.
|
void |
configure(int poolSize)
Configure a new pool size.
|
void |
executeTask(Runnable task)
Execute the task in a free thread or create a new one.
|
abortWhenBlocked, addThread, awaitTerminationAfterShutdown, awaitTerminationAfterShutdown, createThreads, discardOldestWhenBlocked, discardWhenBlocked, drain, execute, getBlockedExecutionHandler, getKeepAliveTime, getMaximumPoolSize, getMinimumPoolSize, getPoolSize, getTask, interruptAll, isTerminatedAfterShutdown, runWhenBlocked, setBlockedExecutionHandler, setKeepAliveTime, setMaximumPoolSize, setMinimumPoolSize, shutdownAfterProcessingCurrentlyQueuedTasks, shutdownAfterProcessingCurrentlyQueuedTasks, shutdownNow, shutdownNow, waitWhenBlocked, workerDone
public DefaultThreadPool(int poolSize, boolean syncThreads)
public void configure(int poolSize)
public void close()
public void executeTask(Runnable task)
task
- The task to executeCopyright © 2006–2013 The Apache Software Foundation. All rights reserved.