Enum Jdk8AsyncOperationEndStrategy
- java.lang.Object
-
- java.lang.Enum<Jdk8AsyncOperationEndStrategy>
-
- io.opentelemetry.instrumentation.api.annotation.support.async.Jdk8AsyncOperationEndStrategy
-
- All Implemented Interfaces:
AsyncOperationEndStrategy,Serializable,Comparable<Jdk8AsyncOperationEndStrategy>
public enum Jdk8AsyncOperationEndStrategy extends Enum<Jdk8AsyncOperationEndStrategy> implements AsyncOperationEndStrategy
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <REQUEST,RESPONSE>
Objectend(io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<REQUEST,RESPONSE> instrumenter, io.opentelemetry.context.Context context, REQUEST request, Object asyncValue, Class<RESPONSE> responseType)Composes overasyncValueand delays theInstrumenter.end(Context, Object, Object, Throwable)call until after the asynchronous operation represented byasyncValuecompletes.booleansupports(Class<?> asyncType)Returns true for every asynchronous computation typeasyncTypethis strategy supports.static Jdk8AsyncOperationEndStrategyvalueOf(String name)Returns the enum constant of this type with the specified name.static Jdk8AsyncOperationEndStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final Jdk8AsyncOperationEndStrategy INSTANCE
-
-
Method Detail
-
values
public static Jdk8AsyncOperationEndStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Jdk8AsyncOperationEndStrategy c : Jdk8AsyncOperationEndStrategy.values()) System.out.println(c);
- 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 nameNullPointerException- if the argument is null
-
supports
public boolean supports(Class<?> asyncType)
Description copied from interface:AsyncOperationEndStrategyReturns true for every asynchronous computation typeasyncTypethis strategy supports.- Specified by:
supportsin interfaceAsyncOperationEndStrategy
-
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:AsyncOperationEndStrategyComposes overasyncValueand delays theInstrumenter.end(Context, Object, Object, Throwable)call until after the asynchronous operation represented byasyncValuecompletes.- Specified by:
endin interfaceAsyncOperationEndStrategy- Parameters:
instrumenter- TheInstrumenterto be used to end the operation stored in thecontext.asyncValue- Return value from the instrumented method. Must be an instance of aasyncTypefor whichAsyncOperationEndStrategy.supports(Class)returned true (in particular it must not benull).responseType- Expected type of the response that should be obtained from theasyncValue. If the result of the async computation is instance of the passed type it will be passed when theinstrumenteris called.- Returns:
- Either
asyncValueor a value composing overasyncValuefor notification of completion.
-
-