Class TransportFilter.QueuingExecutor

java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.glassfish.jersey.jdk.connector.internal.TransportFilter.QueuingExecutor
All Implemented Interfaces:
Executor, ExecutorService
Enclosing class:
TransportFilter

private static class TransportFilter.QueuingExecutor extends ThreadPoolExecutor
A thread pool executor that prefers creating new worker threads over queueing tasks until the maximum poll size has been reached, after which it will start queueing tasks.
  • Field Details

    • taskQueue

      private final Queue<Runnable> taskQueue
    • threadSafeQueue

      private final boolean threadSafeQueue
  • Constructor Details

    • QueuingExecutor

      QueuingExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, Queue<Runnable> taskQueue, boolean threadSafeQueue, ThreadFactory threadFactory)
      Constructor.
      Parameters:
      threadSafeQueue - indicates if taskQueue is thread safe or not.
  • Method Details

    • execute

      public void execute(Runnable task)
      Submit a task for execution, if the maximum thread limit has been reached and all the threads are occupied, enqueue the task. The task is not executed by the current thread, but by a thread from the thread pool.
      Specified by:
      execute in interface Executor
      Overrides:
      execute in class ThreadPoolExecutor
      Parameters:
      task - to be executed.