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 TypeMethodDescriptionvoid
adjustPoolSize
(int newCorePoolSize, int newMaxPoolSize) boolean
awaitTermination
(long timeout, TimeUnit timeUnit) void
protected void
finalize()
int
long
int
long
getKeepAliveTime
(TimeUnit timeUnit) int
protected ReentrantLock
int
getName()
int
int
int
long
protected Set<com.liferay.portal.kernel.concurrent.ThreadPoolExecutor.WorkerTask>
boolean
boolean
boolean
boolean
protected <T> DefaultNoticeableFuture<T>
newTaskFor
(Runnable runnable, T value) protected <T> DefaultNoticeableFuture<T>
newTaskFor
(Callable<T> callable) void
setAllowCoreThreadTimeout
(boolean allowCoreThreadTimeout) void
setKeepAliveTime
(long keepAliveTime, TimeUnit timeUnit) void
void
setRejectedExecutionHandler
(RejectedExecutionHandler rejectedExecutionHandler) void
setThreadFactory
(ThreadFactory threadFactory) void
setThreadPoolHandler
(ThreadPoolHandler threadPoolHandler) void
shutdown()
<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:
submit
in interfaceExecutorService
- Overrides:
submit
in classAbstractExecutorService
-
submit
- Specified by:
submit
in interfaceExecutorService
- Overrides:
submit
in classAbstractExecutorService
-
submit
- Specified by:
submit
in interfaceExecutorService
- Overrides:
submit
in classAbstractExecutorService
-
terminationNoticeableFuture
-
finalize
protected void finalize() -
getMainLock
-
getTaskQueue
-
getWorkerTasks
-
newTaskFor
- Overrides:
newTaskFor
in classAbstractExecutorService
-
newTaskFor
- Overrides:
newTaskFor
in classAbstractExecutorService
-