Package org.forgerock.util.thread
Class MdcScheduledExecutorServiceDelegate
java.lang.Object
org.forgerock.util.thread.MdcExecutorServiceDelegate
org.forgerock.util.thread.MdcScheduledExecutorServiceDelegate
- All Implemented Interfaces:
Executor
,ExecutorService
,ScheduledExecutorService
public class MdcScheduledExecutorServiceDelegate
extends MdcExecutorServiceDelegate
implements ScheduledExecutorService
Store SLF4J Mapped Diagnosed Context (aka MDC) when tasks
are submitted, and re-inject it when tasks are executed.
-
Constructor Summary
ConstructorDescriptionConstructs an instance ofScheduledExecutorService
that will forward the SLF4J Mapped Diagnosed Context to submitted tasks, and will execute these on the provided delegate. -
Method Summary
Modifier and TypeMethodDescription<V> ScheduledFuture<V>
scheduleAtFixedRate
(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay
(Runnable command, long initialDelay, long delay, TimeUnit unit) Methods inherited from class org.forgerock.util.thread.MdcExecutorServiceDelegate
awaitTermination, execute, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
Constructor Details
-
MdcScheduledExecutorServiceDelegate
Constructs an instance ofScheduledExecutorService
that will forward the SLF4J Mapped Diagnosed Context to submitted tasks, and will execute these on the provided delegate.- Parameters:
delegate
- theScheduledExecutorService
to use to execute the submitted tasks
-
-
Method Details
-
schedule
- Specified by:
schedule
in interfaceScheduledExecutorService
-
schedule
- Specified by:
schedule
in interfaceScheduledExecutorService
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRate
in interfaceScheduledExecutorService
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelay
in interfaceScheduledExecutorService
-