Interface SpanningOperationRunner
- All Known Implementing Classes:
SpanningOperationRunnerImpl
@ExperimentalApi
public interface SpanningOperationRunner
Allows to execute some arbitrary code as a part of larger "spanning" operation.
- Since:
- 7.13
-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(SpanningOperation spanningOperation, Runnable runnable) Allows marking events generated by passedrunnablewith passedsurroundingOperationCurrent implementation allows setting spanning operation for current thread only.<T> Texecute(SpanningOperation spanningOperation, Supplier<T> supplier) Allows marking events generated by passedcallablewith passedsurroundingOperation.<T> TexecuteCallable(SpanningOperation spanningOperation, Callable<T> callable) Allows marking events generated by passedcallablewith passedsurroundingOperation.
-
Method Details
-
execute
Allows marking events generated by passedcallablewith passedsurroundingOperation. Current implementation allows setting spanning operation for current thread only. If some other thread is spawned in the passedcallablethen spanning operation has to be set up for the newly started thread. Currently only events that implementSpanningOperationEventare affected by this method.- Type Parameters:
T- Type of returned object- Parameters:
spanningOperation- Operation that spans over passedsuppliersupplier- Set of instructions executed in the context of spanning operation- Returns:
- value returned by passed
supplier
-
execute
Allows marking events generated by passedrunnablewith passedsurroundingOperationCurrent implementation allows setting spanning operation for current thread only. If some other thread is spawned in the passedrunnablethen spanning operation has to be set up for the newly started thread. Currently only events that implementSpanningOperationEventare affected by this method.- Parameters:
spanningOperation- Operation that spans over passedrunnablerunnable-
-
executeCallable
Allows marking events generated by passedcallablewith passedsurroundingOperation. Current implementation allows setting spanning operation for current thread only. If some other thread is spawned in the passedcallablethen spanning operation has to be set up for the newly started thread. Currently only events that implementSpanningOperationEventare affected by this method. Exceptions thrown bycallableare converted toRuntimeExceptionand re-thrown.- Type Parameters:
T- Type of returned object- Parameters:
spanningOperation- Operation that spans over passedcallablecallable- Set of instructions executed in the context of spanning operation- Returns:
- value returned by passed
callable
-