Class SpanningOperationRunnerImpl
java.lang.Object
com.atlassian.jira.event.operation.SpanningOperationRunnerImpl
- All Implemented Interfaces:
SpanningOperationRunner
-
Constructor Summary
ConstructorsConstructorDescriptionSpanningOperationRunnerImpl(SpanningOperationHolder spanningOperationHolder) -
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.
-
Constructor Details
-
SpanningOperationRunnerImpl
-
-
Method Details
-
execute
Description copied from interface:SpanningOperationRunnerAllows 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.- Specified by:
executein interfaceSpanningOperationRunner- 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
Description copied from interface:SpanningOperationRunnerAllows 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.- Specified by:
executein interfaceSpanningOperationRunner- Parameters:
spanningOperation- Operation that spans over passedrunnablerunnable-
-
executeCallable
public <T> T executeCallable(@Nonnull SpanningOperation spanningOperation, @Nonnull Callable<T> callable) Description copied from interface:SpanningOperationRunnerAllows 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.- Specified by:
executeCallablein interfaceSpanningOperationRunner- 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
-