Liferay 7.0-ce-b4

com.liferay.portal.kernel.concurrent
Class ThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by com.liferay.portal.kernel.concurrent.ThreadPoolExecutor
All Implemented Interfaces:
Executor, ExecutorService

public class ThreadPoolExecutor
extends AbstractExecutorService

See https://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)
           
 
Method Summary
 void adjustPoolSize(int newCorePoolSize, int newMaxPoolSize)
           
 boolean awaitTermination(long timeout, TimeUnit timeUnit)
           
 void execute(Runnable runnable)
           
protected  void finalize()
           
 int getActiveCount()
           
 long getCompletedTaskCount()
           
 int getCorePoolSize()
           
 long getKeepAliveTime(TimeUnit timeUnit)
           
 int getLargestPoolSize()
           
protected  ReentrantLock getMainLock()
           
 int getMaxPoolSize()
           
 String getName()
           
 int getPendingTaskCount()
           
 int getPoolSize()
           
 RejectedExecutionHandler getRejectedExecutionHandler()
           
 int getRemainingTaskQueueCapacity()
           
 long getTaskCount()
           
protected  TaskQueue<Runnable> getTaskQueue()
           
 ThreadFactory getThreadFactory()
           
 ThreadPoolHandler getThreadPoolHandler()
           
protected  Set<com.liferay.portal.kernel.concurrent.ThreadPoolExecutor.WorkerTask> getWorkerTasks()
           
 boolean isAllowCoreThreadTimeout()
           
 boolean isShutdown()
           
 boolean isTerminated()
           
 boolean isTerminating()
           
protected
<T> DefaultNoticeableFuture<T>
newTaskFor(Callable<T> callable)
           
protected
<T> DefaultNoticeableFuture<T>
newTaskFor(Runnable runnable, T value)
           
 void setAllowCoreThreadTimeout(boolean allowCoreThreadTimeout)
           
 void setKeepAliveTime(long keepAliveTime, TimeUnit timeUnit)
           
 void setName(String name)
           
 void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
           
 void setThreadFactory(ThreadFactory threadFactory)
           
 void setThreadPoolHandler(ThreadPoolHandler threadPoolHandler)
           
 void shutdown()
           
 List<Runnable> shutdownNow()
           
<T> NoticeableFuture<T>
submit(Callable<T> callable)
           
 NoticeableFuture<?> submit(Runnable runnable)
           
<T> NoticeableFuture<T>
submit(Runnable runnable, T result)
           
 NoticeableFuture<Void> terminationNoticeableFuture()
           
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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()

getName

public String getName()

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)

setName

public void setName(String name)

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()

submit

public <T> NoticeableFuture<T> submit(Callable<T> callable)
Specified by:
submit in interface ExecutorService
Overrides:
submit in class AbstractExecutorService

submit

public NoticeableFuture<?> submit(Runnable runnable)
Specified by:
submit in interface ExecutorService
Overrides:
submit in class AbstractExecutorService

submit

public <T> NoticeableFuture<T> submit(Runnable runnable,
                                      T result)
Specified by:
submit in interface ExecutorService
Overrides:
submit in class AbstractExecutorService

terminationNoticeableFuture

public NoticeableFuture<Void> terminationNoticeableFuture()

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()

newTaskFor

protected <T> DefaultNoticeableFuture<T> newTaskFor(Callable<T> callable)
Overrides:
newTaskFor in class AbstractExecutorService

newTaskFor

protected <T> DefaultNoticeableFuture<T> newTaskFor(Runnable runnable,
                                                    T value)
Overrides:
newTaskFor in class AbstractExecutorService

Liferay 7.0-ce-b4