Project Wonder 5.0

er.extensions.concurrency
Class ERXTaskThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by er.extensions.concurrency.ERXTaskThreadPoolExecutor
All Implemented Interfaces:
java.util.concurrent.Executor, java.util.concurrent.ExecutorService

public class ERXTaskThreadPoolExecutor
extends java.util.concurrent.ThreadPoolExecutor

This is a custom ThreadPoolExecutor subclass whose purpose in life is

This is accomplished by overriding the protected hook methods ThreadPoolExecutor.beforeExecute(Thread t, Runnable r) and ThreadPoolExecutor.afterExecute(Runnable r, Throwable t), and also the submit methods.

A user does not generally need to instantiate this class. This class is generally used by ExecutorService instances that are created by ERXExecutorService static utility methods.

See Also:
ERXExecutorService, ERXTaskThreadFactory, ERXTaskThread
Author:
kieran

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
 
Constructor Summary
ERXTaskThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue)
           
ERXTaskThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.RejectedExecutionHandler handler)
           
ERXTaskThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory)
           
ERXTaskThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler)
           
 
Method Summary
protected  void afterExecute(java.lang.Runnable r, java.lang.Throwable t)
           
protected  void beforeExecute(java.lang.Thread t, java.lang.Runnable r)
           
<T> java.util.concurrent.Future<T>
submit(java.util.concurrent.Callable<T> task)
           
 java.util.concurrent.Future<?> submit(java.lang.Runnable task)
           
<T> java.util.concurrent.Future<T>
submit(java.lang.Runnable task, T result)
           
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXTaskThreadPoolExecutor

public ERXTaskThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 long keepAliveTime,
                                 java.util.concurrent.TimeUnit unit,
                                 java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue)

ERXTaskThreadPoolExecutor

public ERXTaskThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 long keepAliveTime,
                                 java.util.concurrent.TimeUnit unit,
                                 java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
                                 java.util.concurrent.ThreadFactory threadFactory)

ERXTaskThreadPoolExecutor

public ERXTaskThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 long keepAliveTime,
                                 java.util.concurrent.TimeUnit unit,
                                 java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
                                 java.util.concurrent.RejectedExecutionHandler handler)

ERXTaskThreadPoolExecutor

public ERXTaskThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 long keepAliveTime,
                                 java.util.concurrent.TimeUnit unit,
                                 java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
                                 java.util.concurrent.ThreadFactory threadFactory,
                                 java.util.concurrent.RejectedExecutionHandler handler)
Method Detail

submit

public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
Specified by:
submit in interface java.util.concurrent.ExecutorService
Overrides:
submit in class java.util.concurrent.AbstractExecutorService

submit

public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task,
                                                 T result)
Specified by:
submit in interface java.util.concurrent.ExecutorService
Overrides:
submit in class java.util.concurrent.AbstractExecutorService

submit

public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
Specified by:
submit in interface java.util.concurrent.ExecutorService
Overrides:
submit in class java.util.concurrent.AbstractExecutorService

beforeExecute

protected void beforeExecute(java.lang.Thread t,
                             java.lang.Runnable r)
Overrides:
beforeExecute in class java.util.concurrent.ThreadPoolExecutor

afterExecute

protected void afterExecute(java.lang.Runnable r,
                            java.lang.Throwable t)
Overrides:
afterExecute in class java.util.concurrent.ThreadPoolExecutor

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.