Top Description Fields Constructors Methods
io.micrometer.tracing.annotation

public Class ImperativeMethodInvocationProcessor

extends AbstractMethodInvocationProcessor
Class Inheritance
Imports
io.micrometer.common.annotation.ValueExpressionResolver, .ValueResolver, io.micrometer.common.lang.Nullable, io.micrometer.common.util.StringUtils, io.micrometer.tracing.Span, .Tracer, org.aopalliance.intercept.MethodInvocation, java.util.function.Function

Method Invocation processor for imperative code. Code ported from Spring Cloud Sleuth.
Author
Marcin Grzejszczak
Since
1.1.0

Field Summary

Inherited from io.micrometer.tracing.annotation.AbstractMethodInvocationProcessor:
currentTraceContextnewSpanParserspanTagAnnotationHandlertracer

Constructor Summary

AccessConstructor and Description
public
ImperativeMethodInvocationProcessor(NewSpanParser
new span parser
newSpanParser
,
Tracer
tracer
tracer
,
Function<Class<? extends ValueResolver>, ? extends ValueResolver>
converts a class into an instance of resolver provider
resolverProvider
,
Function<Class<? extends ValueExpressionResolver>, ? extends ValueExpressionResolver>
converts a class into an instance of expression resolver provider
expressionResolverProvider
)

Creates a new instance of ImperativeMethodInvocationProcessor.

public
ImperativeMethodInvocationProcessor(NewSpanParser
new span parser
newSpanParser
,
Tracer
tracer
tracer
)

Creates a new instance of ImperativeMethodInvocationProcessor.

public
ImperativeMethodInvocationProcessor(NewSpanParser
new span parser
newSpanParser
,
Tracer
tracer
tracer
,
SpanTagAnnotationHandler
resolves tags to be added to the span from the annotations
spanTagAnnotationHandler
)

Creates a new instance of ImperativeMethodInvocationProcessor.

Method Summary

Modifier and TypeMethod and Description
private Object
public Object
process(MethodInvocation
method invocation
invocation
,
NewSpan
annotation
newSpan
,
ContinueSpan
annotation
continueSpan
)

Implements io.micrometer.tracing.annotation.MethodInvocationProcessor.process.

Executes the annotated method.
Inherited from io.micrometer.tracing.annotation.AbstractMethodInvocationProcessor:
addTagsafterbeforeloglogEventonFailuresetSpanTagAnnotationHandler

Constructor Detail

ImperativeMethodInvocationProcessorback to summary
public ImperativeMethodInvocationProcessor(NewSpanParser newSpanParser, Tracer tracer, Function<Class<? extends ValueResolver>, ? extends ValueResolver> resolverProvider, Function<Class<? extends ValueExpressionResolver>, ? extends ValueExpressionResolver> expressionResolverProvider)

Creates a new instance of ImperativeMethodInvocationProcessor.

Parameters
newSpanParser:NewSpanParser

new span parser

tracer:Tracer

tracer

resolverProvider:Function<Class<? extends ValueResolver>, ? extends ValueResolver>

converts a class into an instance of resolver provider

expressionResolverProvider:Function<Class<? extends ValueExpressionResolver>, ? extends ValueExpressionResolver>

converts a class into an instance of expression resolver provider

ImperativeMethodInvocationProcessorback to summary
public ImperativeMethodInvocationProcessor(NewSpanParser newSpanParser, Tracer tracer)

Creates a new instance of ImperativeMethodInvocationProcessor.

Parameters
newSpanParser:NewSpanParser

new span parser

tracer:Tracer

tracer

ImperativeMethodInvocationProcessorback to summary
public ImperativeMethodInvocationProcessor(NewSpanParser newSpanParser, Tracer tracer, SpanTagAnnotationHandler spanTagAnnotationHandler)

Creates a new instance of ImperativeMethodInvocationProcessor.

Parameters
newSpanParser:NewSpanParser

new span parser

tracer:Tracer

tracer

spanTagAnnotationHandler:SpanTagAnnotationHandler

resolves tags to be added to the span from the annotations

Method Detail

proceedUnderSynchronousSpanback to summary
private Object proceedUnderSynchronousSpan(MethodInvocation invocation, NewSpan newSpan, ContinueSpan continueSpan) throws Throwable
processback to summary
public Object process(MethodInvocation invocation, NewSpan newSpan, ContinueSpan continueSpan) throws Throwable

Implements io.micrometer.tracing.annotation.MethodInvocationProcessor.process.

Doc from io.micrometer.tracing.annotation.MethodInvocationProcessor.process.

Executes the annotated method.

Parameters
invocation:MethodInvocation

method invocation

newSpan:NewSpan

annotation

continueSpan:ContinueSpan

annotation

Returns:Object

executed method result

Annotations
@Override
Exceptions
Throwable:
exception upon running a method