Class SpanningOperationRunnerImpl

java.lang.Object
com.atlassian.jira.event.operation.SpanningOperationRunnerImpl
All Implemented Interfaces:
SpanningOperationRunner

public class SpanningOperationRunnerImpl extends Object implements SpanningOperationRunner
  • Constructor Details

    • SpanningOperationRunnerImpl

      public SpanningOperationRunnerImpl(SpanningOperationHolder spanningOperationHolder)
  • Method Details

    • execute

      public <T> T execute(SpanningOperation spanningOperation, Supplier<T> supplier)
      Description copied from interface: SpanningOperationRunner
      Allows marking events generated by passed 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.
      Specified by:
      execute in interface SpanningOperationRunner
      Type Parameters:
      T - Type of returned object
      Parameters:
      spanningOperation - Operation that spans over passed supplier
      supplier - Set of instructions executed in the context of spanning operation
      Returns:
      value returned by passed supplier
    • execute

      public void execute(SpanningOperation spanningOperation, Runnable runnable)
      Description copied from interface: SpanningOperationRunner
      Allows marking events generated by passed 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.
      Specified by:
      execute in interface SpanningOperationRunner
      Parameters:
      spanningOperation - Operation that spans over passed runnable
      runnable -
    • executeCallable

      public <T> T executeCallable(@Nonnull SpanningOperation spanningOperation, @Nonnull Callable<T> callable)
      Description copied from interface: SpanningOperationRunner
      Allows marking events generated by passed 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.
      Specified by:
      executeCallable in interface SpanningOperationRunner
      Type Parameters:
      T - Type of returned object
      Parameters:
      spanningOperation - Operation that spans over passed callable
      callable - Set of instructions executed in the context of spanning operation
      Returns:
      value returned by passed callable