Class EsThreadPoolExecutor

  • All Implemented Interfaces:
    java.util.concurrent.Executor, java.util.concurrent.ExecutorService
    Direct Known Subclasses:
    PrioritizedEsThreadPoolExecutor, QueueResizingEsThreadPoolExecutor

    public class EsThreadPoolExecutor
    extends java.util.concurrent.ThreadPoolExecutor
    An extension to thread pool executor, allowing (in the future) to add specific additional stats to it.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  EsThreadPoolExecutor.ShutdownListener  
      • 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
    • Method Summary

      Modifier and Type Method Description
      protected void afterExecute​(java.lang.Runnable r, java.lang.Throwable t)  
      protected void appendThreadPoolExecutorDetails​(java.lang.StringBuilder sb)
      Append details about this thread pool to the specified StringBuilder.
      void execute​(java.lang.Runnable command)  
      java.util.stream.Stream<java.lang.Runnable> getTasks()
      Returns a stream of all pending tasks.
      void shutdown​(EsThreadPoolExecutor.ShutdownListener listener)  
      protected void terminated()  
      java.lang.String toString()  
      protected java.lang.Runnable unwrap​(java.lang.Runnable runnable)  
      protected java.lang.Runnable wrapRunnable​(java.lang.Runnable command)  
      • 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
      • 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
    • Method Detail

      • terminated

        protected void terminated()
        Overrides:
        terminated in class java.util.concurrent.ThreadPoolExecutor
      • execute

        public void execute​(java.lang.Runnable command)
        Specified by:
        execute in interface java.util.concurrent.Executor
        Overrides:
        execute 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
      • getTasks

        public java.util.stream.Stream<java.lang.Runnable> getTasks()
        Returns a stream of all pending tasks. This is similar to ThreadPoolExecutor.getQueue() but will expose the originally submitted Runnable instances rather than potentially wrapped ones.
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.util.concurrent.ThreadPoolExecutor
      • appendThreadPoolExecutorDetails

        protected void appendThreadPoolExecutorDetails​(java.lang.StringBuilder sb)
        Append details about this thread pool to the specified StringBuilder. All details should be appended as key/value pairs in the form "%s = %s, "
        Parameters:
        sb - the StringBuilder to append to
      • wrapRunnable

        protected java.lang.Runnable wrapRunnable​(java.lang.Runnable command)
      • unwrap

        protected java.lang.Runnable unwrap​(java.lang.Runnable runnable)