apm-sniffer/optional-plugins/optional-spring-plugins/mvc-annotation-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v6/InvokeInterceptor.java [40:59]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInvocationContext context) throws Throwable {
        ServerWebExchange exchange = (ServerWebExchange) allArguments[0];
        final ServerHttpResponse response = exchange.getResponse();
        /**
         * First, we put the slot in the RuntimeContext,
         * as well as the MethodInvocationContext (MIC),
         * so that we can access it in the {@link org.apache.skywalking.apm.plugin.spring.mvc.v6.InvokeInterceptor#afterMethod}
         * Then we fetch the slot from {@link org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.AbstractMethodInterceptor#afterMethod}
         * and fulfill the slot with the real AbstractSpan.
         * Afterwards, we can safely remove the RuntimeContext.
         * Finally, when the lambda executes in the {@link reactor.core.publisher.Mono#doFinally},
         * ref of span could be acquired from MIC.
         */
        AbstractSpan[] ref = new AbstractSpan[1];
        RuntimeContext runtimeContext = ContextManager.getRuntimeContext();
        runtimeContext.put(REACTIVE_ASYNC_SPAN_IN_RUNTIME_CONTEXT, ref);
        runtimeContext.put(RESPONSE_KEY_IN_RUNTIME_CONTEXT, response);
        runtimeContext.put(REQUEST_KEY_IN_RUNTIME_CONTEXT, exchange.getRequest());
        context.setContext(ref);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/InvokeInterceptor.java [40:59]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInvocationContext context) throws Throwable {
        ServerWebExchange exchange = (ServerWebExchange) allArguments[0];
        final ServerHttpResponse response = exchange.getResponse();
        /**
         * First, we put the slot in the RuntimeContext,
         * as well as the MethodInvocationContext (MIC),
         * so that we can access it in the {@link org.apache.skywalking.apm.plugin.spring.mvc.v5.InvokeInterceptor#afterMethod}
         * Then we fetch the slot from {@link org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.AbstractMethodInterceptor#afterMethod}
         * and fulfill the slot with the real AbstractSpan.
         * Afterwards, we can safely remove the RuntimeContext.
         * Finally, when the lambda executes in the {@link reactor.core.publisher.Mono#doFinally},
         * ref of span could be acquired from MIC.
         */
        AbstractSpan[] ref = new AbstractSpan[1];
        RuntimeContext runtimeContext = ContextManager.getRuntimeContext();
        runtimeContext.put(REACTIVE_ASYNC_SPAN_IN_RUNTIME_CONTEXT, ref);
        runtimeContext.put(RESPONSE_KEY_IN_RUNTIME_CONTEXT, response);
        runtimeContext.put(REQUEST_KEY_IN_RUNTIME_CONTEXT, exchange.getRequest());
        context.setContext(ref);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



