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)
SpanningOperationRunner
callable
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 SpanningOperationRunner
T
- Type of returned objectspanningOperation
- Operation that spans over passed supplier
supplier
- Set of instructions executed in the context of spanning operationsupplier
public void execute(SpanningOperation spanningOperation, Runnable runnable)
SpanningOperationRunner
runnable
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 SpanningOperationRunner
spanningOperation
- Operation that spans over passed runnable
public <T> T executeCallable(@Nonnull SpanningOperation spanningOperation, @Nonnull Callable<T> callable)
SpanningOperationRunner
callable
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 SpanningOperationRunner
T
- Type of returned objectspanningOperation
- Operation that spans over passed callable
callable
- Set of instructions executed in the context of spanning operationcallable
Copyright © 2002-2021 Atlassian. All Rights Reserved.