public class SpanningOperationRunnerImpl extends Object implements SpanningOperationRunner
| Constructor and Description |
|---|
SpanningOperationRunnerImpl(SpanningOperationHolder spanningOperationHolder) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(SpanningOperation spanningOperation,
Runnable runnable)
Allows marking events generated by passed
runnable with passed surroundingOperation
Current implementation allows setting spanning operation for current thread only. |
<T> T |
execute(SpanningOperation spanningOperation,
java.util.function.Supplier<T> supplier)
Allows marking events generated by passed
callable with passed surroundingOperation. |
<T> T |
executeCallable(SpanningOperation spanningOperation,
Callable<T> callable)
Allows marking events generated by passed
callable with passed surroundingOperation. |
public SpanningOperationRunnerImpl(SpanningOperationHolder spanningOperationHolder)
public <T> T execute(SpanningOperation spanningOperation, java.util.function.Supplier<T> supplier)
SpanningOperationRunnercallable with passed surroundingOperation.
Current implementation allows setting spanning operation for current thread only.
If some other thread is spawned in the passed callable then spanning operation has to be set up for the newly started thread.
Currently only events that implement SpanningOperationEvent are affected by this method.execute in interface SpanningOperationRunnerT - Type of returned objectspanningOperation - Operation that spans over passed suppliersupplier - Set of instructions executed in the context of spanning operationsupplierpublic void execute(SpanningOperation spanningOperation, Runnable runnable)
SpanningOperationRunnerrunnable with passed surroundingOperation
Current implementation allows setting spanning operation for current thread only.
If some other thread is spawned in the passed runnable then spanning operation has to be set up for the newly started thread.
Currently only events that implement SpanningOperationEvent are affected by this method.execute in interface SpanningOperationRunnerspanningOperation - Operation that spans over passed runnablepublic <T> T executeCallable(@Nonnull SpanningOperation spanningOperation, @Nonnull Callable<T> callable)
SpanningOperationRunnercallable with passed surroundingOperation.
Current implementation allows setting spanning operation for current thread only.
If some other thread is spawned in the passed callable then spanning operation has to be set up for the newly started thread.
Currently only events that implement SpanningOperationEvent are affected by this method.
Exceptions thrown by callable are converted to RuntimeException and re-thrown.executeCallable in interface SpanningOperationRunnerT - Type of returned objectspanningOperation - Operation that spans over passed callablecallable - Set of instructions executed in the context of spanning operationcallableCopyright © 2002-2022 Atlassian. All Rights Reserved.