Package com.complexible.common.util.concurrent

# Class BlockingThreadPoolExecutor

java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
com.complexible.common.util.concurrent.BlockingThreadPoolExecutor

All Implemented Interfaces:
  `AutoCloseable`, `Executor`, `ExecutorService`

public final class BlockingThreadPoolExecutor extends ThreadPoolExecutor

`ThreadPoolExecutor` which has a limited number of outstanding permits for executing tasks and when there are no more permits left, `new tasks` will block waiting for a permit to free up instead of throwing an exception.

Since:
  1.1
Version:
  3.0
Author:
  Michael Grove

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `BlockingThreadPoolExecutor.ExceptionHandler`
  `static class`
  `BlockingThreadPoolExecutor.SilentExceptionHandler`

  ## Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor

  `ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, int theBoundedSize)`
  `BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, RejectedExecutionHandler theRejectedExecutionHandler, int theBoundedSize)`
  `BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, ThreadFactory theThreadFactory, int theBoundedSize)`
  `BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, ThreadFactory theThreadFactory, RejectedExecutionHandler theRejectedExecutionHandler, int theBoundedSize)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `afterExecute(Runnable theRunnable, Throwable theThrowable)`
  `void`
  `execute(Runnable task)`
  `void`
  `setExceptionHandler(BlockingThreadPoolExecutor.ExceptionHandler theExceptionHandler)`

  ### Methods inherited from class java.util.concurrent.ThreadPoolExecutor

  `allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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, toString`

  ### Methods inherited from class java.util.concurrent.AbstractExecutorService

  `invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit`

  ### Methods inherited from class java.lang.Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.concurrent.ExecutorService

  `close`

- ## Constructor Details

  - ### BlockingThreadPoolExecutor

    public BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, int theBoundedSize)

  - ### BlockingThreadPoolExecutor

    public BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, ThreadFactory theThreadFactory, int theBoundedSize)

  - ### BlockingThreadPoolExecutor

    public BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, RejectedExecutionHandler theRejectedExecutionHandler, int theBoundedSize)

  - ### BlockingThreadPoolExecutor

    public BlockingThreadPoolExecutor(int theCorePoolSize, int theMaxPoolSize, long theKeepAliveTime, TimeUnit theTimeUnit, BlockingQueue<Runnable> theWorkQueue, ThreadFactory theThreadFactory, RejectedExecutionHandler theRejectedExecutionHandler, int theBoundedSize)

- ## Method Details

  - ### setExceptionHandler

    public void setExceptionHandler(BlockingThreadPoolExecutor.ExceptionHandler theExceptionHandler)

  - ### execute

    public void execute(Runnable task)
    Specified by:
      `execute` in interface `Executor`
    Overrides:
      `execute` in class `ThreadPoolExecutor`

  - ### afterExecute

    protected void afterExecute(Runnable theRunnable, Throwable theThrowable)
    Overrides:
      `afterExecute` in class `ThreadPoolExecutor`