Class ExecutorInstrumentationUtils


  • public class ExecutorInstrumentationUtils
    extends java.lang.Object
    Utils for concurrent instrumentations.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void cleanUpOnMethodExit​(State state, java.lang.Throwable throwable)
      Clean up after job submission method has exited.
      static <T> State setupState​(ContextStore<T,​State> contextStore, T task, io.opentelemetry.context.Context context)
      Create task state given current scope.
      static boolean shouldAttachStateToTask​(java.lang.Object task)
      Checks if given task should get state attached.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExecutorInstrumentationUtils

        public ExecutorInstrumentationUtils()
    • Method Detail

      • shouldAttachStateToTask

        public static boolean shouldAttachStateToTask​(java.lang.Object task)
        Checks if given task should get state attached.
        Parameters:
        task - task object
        Returns:
        true iff given task object should be wrapped
      • setupState

        public static <T> State setupState​(ContextStore<T,​State> contextStore,
                                           T task,
                                           io.opentelemetry.context.Context context)
        Create task state given current scope.
        Type Parameters:
        T - task class type
        Parameters:
        contextStore - context storage
        task - task instance
        context - current context
        Returns:
        new state
      • cleanUpOnMethodExit

        public static void cleanUpOnMethodExit​(State state,
                                               java.lang.Throwable throwable)
        Clean up after job submission method has exited.
        Parameters:
        state - task instrumentation state
        throwable - throwable that may have been thrown