Interface AsyncOperationEndStrategy
-
- All Known Implementing Classes:
Jdk8AsyncOperationEndStrategy
public interface AsyncOperationEndStrategyImplementations of this interface describe how to compose over supported asynchronous computation types and delay marking the operation as ended by callingInstrumenter.end(Context, Object, Object, Throwable).
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
supports
boolean supports(Class<?> asyncType)
Returns true for every asynchronous computation typeasyncTypethis strategy supports.
-
end
<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)
Composes overasyncValueand delays theInstrumenter.end(Context, Object, Object, Throwable)call until after the asynchronous operation represented byasyncValuecompletes.- 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 whichsupports(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.
-
-