Class ThreadRenamingExecutor
- java.lang.Object
-
- org.threadly.concurrent.AbstractSubmitterExecutor
-
- org.threadly.concurrent.wrapper.traceability.ThreadRenamingExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor
,SubmitterExecutor
public class ThreadRenamingExecutor extends AbstractSubmitterExecutor
Class which wraps aExecutor
and wraps all supplied tasks in aThreadRenamingRunnable
. This allows you to make a pool where all tasks submitted inside it have the threads named in an identifiable way.- Since:
- 4.8.0 (since 4.3.0 as org.threadly.concurrent.ThreadRenamingExecutorWrapper)
-
-
Constructor Summary
Constructors Constructor Description ThreadRenamingExecutor(java.util.concurrent.Executor executor, java.lang.String threadName, boolean replace)
Constructs a newThreadRenamingExecutor
, wrapping a suppliedExecutor
.
-
Method Summary
-
Methods inherited from class org.threadly.concurrent.AbstractSubmitterExecutor
execute, submit, submit
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.threadly.concurrent.SubmitterExecutor
submit
-
-
-
-
Constructor Detail
-
ThreadRenamingExecutor
public ThreadRenamingExecutor(java.util.concurrent.Executor executor, java.lang.String threadName, boolean replace)
Constructs a newThreadRenamingExecutor
, wrapping a suppliedExecutor
. Ifreplace
isfalse
the thread will be named such thatthreadName[originalThreadName]
.- Parameters:
executor
- Executor to wrap and send executions tothreadName
- Thread name prefix, or replaced namereplace
- Iftrue
the original name wont be included in the thread name
-
-