java.lang.Runnablepublic class RunnableWithContext extends WrapperWithContext<java.lang.Runnable> implements java.lang.Runnable
Runnable that reactivates a context snapshot before
calling a delegate.consumer, snapshot| Constructor | Description |
|---|---|
RunnableWithContext(ContextSnapshot snapshot,
java.lang.Runnable delegate) |
Creates a new runnable that performs the following steps, in-order:
first reactivate the given snapshot
then run the delegate
|
RunnableWithContext(ContextSnapshot snapshot,
java.lang.Runnable delegate,
java.util.function.Consumer<ContextSnapshot> consumer) |
Creates a new runnable that performs the following steps, in-order:
first reactivate the given snapshot
then run the delegate
finally, if a consumer was provided
capture a new ContextSnapshot
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
run() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitdelegate, nonNullDelegateequals, hashCode, toStringpublic RunnableWithContext(ContextSnapshot snapshot, java.lang.Runnable delegate)
snapshot - A snapshot for the contexts to run the delegate in.delegate - The delegate to run.RunnableWithContext(ContextSnapshot, Runnable, Consumer)public RunnableWithContext(ContextSnapshot snapshot, java.lang.Runnable delegate, java.util.function.Consumer<ContextSnapshot> consumer)
snapshot - A snapshot for the contexts to run the delegate in.delegate - The delegate to run.consumer - An optional consumer for the resulting contexts after the delegate ran (in case it changed)Copyright © 2016–2018 Talsma ICT. All rights reserved.