Class ThreadRenamingExecutor

  • All Implemented Interfaces:
    java.util.concurrent.Executor, SubmitterExecutor

    public class ThreadRenamingExecutor
    extends AbstractSubmitterExecutor
    Class which wraps a Executor and wraps all supplied tasks in a ThreadRenamingRunnable. This allows you to make a pool where all tasks submitted inside it have the threads named in an identifiable way.
    4.8.0 (since 4.3.0 as org.threadly.concurrent.ThreadRenamingExecutorWrapper)
    • Constructor Detail

      • ThreadRenamingExecutor

        public ThreadRenamingExecutor​(java.util.concurrent.Executor executor,
                                      java.lang.String threadName,
                                      boolean replace)
        Constructs a new ThreadRenamingExecutor, wrapping a supplied Executor. If replace is false the thread will be named such that threadName[originalThreadName].
        executor - Executor to wrap and send executions to
        threadName - Thread name prefix, or replaced name
        replace - If true the original name wont be included in the thread name