Class ExecutorInstrumentationUtils
- java.lang.Object
-
- io.opentelemetry.javaagent.instrumentation.api.concurrent.ExecutorInstrumentationUtils
-
public class ExecutorInstrumentationUtils extends java.lang.ObjectUtils for concurrent instrumentations.
-
-
Constructor Summary
Constructors Constructor Description ExecutorInstrumentationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcleanUpOnMethodExit(State state, java.lang.Throwable throwable)Clean up after job submission method has exited.static <T> StatesetupState(ContextStore<T,State> contextStore, T task, io.opentelemetry.context.Context context)Create task state given current scope.static booleanshouldAttachStateToTask(java.lang.Object task)Checks if given task should get state attached.
-
-
-
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 storagetask- task instancecontext- 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 statethrowable- throwable that may have been thrown
-
-