com.liferay.portal.kernel.concurrent
Class ThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
com.liferay.portal.kernel.concurrent.ThreadPoolExecutor
- All Implemented Interfaces:
- Executor, ExecutorService
public class ThreadPoolExecutor
- extends AbstractExecutorService
See http://issues.liferay.com/browse/LPS-14986.
Constructor Summary |
ThreadPoolExecutor(int corePoolSize,
int maxPoolSize)
|
ThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
TimeUnit timeUnit,
boolean allowCoreThreadTimeout,
int maxQueueSize)
|
ThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
TimeUnit timeUnit,
boolean allowCoreThreadTimeout,
int maxQueueSize,
RejectedExecutionHandler rejectedExecutionHandler,
ThreadFactory threadFactory,
ThreadPoolHandler threadPoolHandler)
|
ThreadPoolExecutor
public ThreadPoolExecutor(int corePoolSize,
int maxPoolSize)
ThreadPoolExecutor
public ThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
TimeUnit timeUnit,
boolean allowCoreThreadTimeout,
int maxQueueSize)
ThreadPoolExecutor
public ThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
TimeUnit timeUnit,
boolean allowCoreThreadTimeout,
int maxQueueSize,
RejectedExecutionHandler rejectedExecutionHandler,
ThreadFactory threadFactory,
ThreadPoolHandler threadPoolHandler)
adjustPoolSize
public void adjustPoolSize(int newCorePoolSize,
int newMaxPoolSize)
awaitTermination
public boolean awaitTermination(long timeout,
TimeUnit timeUnit)
throws InterruptedException
- Throws:
InterruptedException
execute
public void execute(Runnable runnable)
getActiveCount
public int getActiveCount()
getCompletedTaskCount
public long getCompletedTaskCount()
getCorePoolSize
public int getCorePoolSize()
getKeepAliveTime
public long getKeepAliveTime(TimeUnit timeUnit)
getLargestPoolSize
public int getLargestPoolSize()
getMaxPoolSize
public int getMaxPoolSize()
getPendingTaskCount
public int getPendingTaskCount()
getPoolSize
public int getPoolSize()
getRejectedExecutionHandler
public RejectedExecutionHandler getRejectedExecutionHandler()
getRemainingTaskQueueCapacity
public int getRemainingTaskQueueCapacity()
getTaskCount
public long getTaskCount()
getThreadFactory
public ThreadFactory getThreadFactory()
getThreadPoolHandler
public ThreadPoolHandler getThreadPoolHandler()
isAllowCoreThreadTimeout
public boolean isAllowCoreThreadTimeout()
isShutdown
public boolean isShutdown()
isTerminated
public boolean isTerminated()
isTerminating
public boolean isTerminating()
setAllowCoreThreadTimeout
public void setAllowCoreThreadTimeout(boolean allowCoreThreadTimeout)
setKeepAliveTime
public void setKeepAliveTime(long keepAliveTime,
TimeUnit timeUnit)
setRejectedExecutionHandler
public void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
setThreadFactory
public void setThreadFactory(ThreadFactory threadFactory)
setThreadPoolHandler
public void setThreadPoolHandler(ThreadPoolHandler threadPoolHandler)
shutdown
public void shutdown()
shutdownNow
public List<Runnable> shutdownNow()
finalize
protected void finalize()
- Overrides:
finalize
in class Object
getMainLock
protected ReentrantLock getMainLock()
getTaskQueue
protected TaskQueue<Runnable> getTaskQueue()
getWorkerTasks
protected Set<com.liferay.portal.kernel.concurrent.ThreadPoolExecutor.WorkerTask> getWorkerTasks()