Class ThreadPoolExecutor
Object
AbstractExecutorService
com.liferay.portal.kernel.concurrent.ThreadPoolExecutor
- All Implemented Interfaces:
Executor,ExecutorService
See https://issues.liferay.com/browse/LPS-14986.
- Author:
- Shuyang Zhou
-
Constructor Summary
ConstructorsConstructorDescriptionThreadPoolExecutor(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) -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustPoolSize(int newCorePoolSize, int newMaxPoolSize) booleanawaitTermination(long timeout, TimeUnit timeUnit) voidprotected voidfinalize()intlongintlonggetKeepAliveTime(TimeUnit timeUnit) intprotected ReentrantLockintgetName()intintintlongprotected Set<com.liferay.portal.kernel.concurrent.ThreadPoolExecutor.WorkerTask>booleanbooleanbooleanbooleanprotected <T> DefaultNoticeableFuture<T>newTaskFor(Runnable runnable, T value) protected <T> DefaultNoticeableFuture<T>newTaskFor(Callable<T> callable) voidsetAllowCoreThreadTimeout(boolean allowCoreThreadTimeout) voidsetKeepAliveTime(long keepAliveTime, TimeUnit timeUnit) voidvoidsetRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler) voidsetThreadFactory(ThreadFactory threadFactory) voidsetThreadPoolHandler(ThreadPoolHandler threadPoolHandler) voidshutdown()<T> NoticeableFuture<T><T> NoticeableFuture<T>Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny
-
Constructor Details
-
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)
-
-
Method Details
-
adjustPoolSize
public void adjustPoolSize(int newCorePoolSize, int newMaxPoolSize) -
awaitTermination
- Throws:
InterruptedException
-
execute
-
getActiveCount
public int getActiveCount() -
getCompletedTaskCount
public long getCompletedTaskCount() -
getCorePoolSize
public int getCorePoolSize() -
getKeepAliveTime
-
getLargestPoolSize
public int getLargestPoolSize() -
getMaxPoolSize
public int getMaxPoolSize() -
getName
-
getPendingTaskCount
public int getPendingTaskCount() -
getPoolSize
public int getPoolSize() -
getRejectedExecutionHandler
-
getRemainingTaskQueueCapacity
public int getRemainingTaskQueueCapacity() -
getTaskCount
public long getTaskCount() -
getThreadFactory
-
getThreadPoolHandler
-
isAllowCoreThreadTimeout
public boolean isAllowCoreThreadTimeout() -
isShutdown
public boolean isShutdown() -
isTerminated
public boolean isTerminated() -
isTerminating
public boolean isTerminating() -
setAllowCoreThreadTimeout
public void setAllowCoreThreadTimeout(boolean allowCoreThreadTimeout) -
setKeepAliveTime
-
setName
-
setRejectedExecutionHandler
-
setThreadFactory
-
setThreadPoolHandler
-
shutdown
public void shutdown() -
shutdownNow
-
submit
- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
terminationNoticeableFuture
-
finalize
protected void finalize() -
getMainLock
-
getTaskQueue
-
getWorkerTasks
-
newTaskFor
- Overrides:
newTaskForin classAbstractExecutorService
-
newTaskFor
- Overrides:
newTaskForin classAbstractExecutorService
-