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
Constructors Constructor Description MdcScheduledExecutorServiceDelegate(ScheduledExecutorService delegate)
Constructs an instance ofScheduledExecutorService
that will forward the SLF4J Mapped Diagnosed Context to submitted tasks, and will execute these on the provided delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScheduledFuture<?>
schedule(Runnable command, long delay, TimeUnit unit)
<V> ScheduledFuture<V>
schedule(Callable<V> callable, long delay, TimeUnit unit)
ScheduledFuture<?>
scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
ScheduledFuture<?>
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 Detail
-
MdcScheduledExecutorServiceDelegate
public MdcScheduledExecutorServiceDelegate(ScheduledExecutorService delegate)
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 Detail
-
schedule
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
- Specified by:
schedule
in interfaceScheduledExecutorService
-
schedule
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
- 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
-
-