Enum Jdk8AsyncOperationEndStrategy

java.lang.Object
java.lang.Enum<Jdk8AsyncOperationEndStrategy>
io.opentelemetry.instrumentation.api.annotation.support.async.Jdk8AsyncOperationEndStrategy
All Implemented Interfaces:
AsyncOperationEndStrategy, Serializable, Comparable<Jdk8AsyncOperationEndStrategy>, java.lang.constant.Constable

public enum Jdk8AsyncOperationEndStrategy extends Enum<Jdk8AsyncOperationEndStrategy> implements AsyncOperationEndStrategy
  • Enum Constant Details

  • Method Details

    • values

      public static Jdk8AsyncOperationEndStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Jdk8AsyncOperationEndStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • supports

      public boolean supports(Class<?> asyncType)
      Description copied from interface: AsyncOperationEndStrategy
      Returns true for every asynchronous computation type asyncType this strategy supports.
      Specified by:
      supports in interface AsyncOperationEndStrategy
    • end

      public <REQUEST, RESPONSE> Object end(io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<REQUEST,RESPONSE> instrumenter, io.opentelemetry.context.Context context, REQUEST request, Object asyncValue, Class<RESPONSE> responseType)
      Description copied from interface: AsyncOperationEndStrategy
      Composes over asyncValue and delays the Instrumenter.end(Context, Object, Object, Throwable) call until after the asynchronous operation represented by asyncValue completes.
      Specified by:
      end in interface AsyncOperationEndStrategy
      Parameters:
      instrumenter - The Instrumenter to be used to end the operation stored in the context.
      asyncValue - Return value from the instrumented method. Must be an instance of a asyncType for which AsyncOperationEndStrategy.supports(Class) returned true (in particular it must not be null).
      responseType - Expected type of the response that should be obtained from the asyncValue. If the result of the async computation is instance of the passed type it will be passed when the instrumenter is called.
      Returns:
      Either asyncValue or a value composing over asyncValue for notification of completion.