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
ConstructorsConstructorDescriptionConstructs an instance ofScheduledExecutorServicethat 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, submitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 ofScheduledExecutorServicethat will forward the SLF4J Mapped Diagnosed Context to submitted tasks, and will execute these on the provided delegate.- Parameters:
delegate- theScheduledExecutorServiceto use to execute the submitted tasks
-
-
Method Details
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService
-