apm-sniffer/optional-plugins/optional-spring-plugins/mvc-annotation-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v6/GetBeanInterceptor.java [43:61]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
                              Object ret) throws Throwable {
        if (ret instanceof EnhancedInstance) {
            ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
            if (requestAttributes != null) {
                ContextManager.getRuntimeContext()
                              .put(
                                  REQUEST_KEY_IN_RUNTIME_CONTEXT,
                                  requestAttributes.getRequest()
                              );
                ContextManager.getRuntimeContext()
                              .put(
                                  RESPONSE_KEY_IN_RUNTIME_CONTEXT,
                                  requestAttributes.getResponse()
                              );
            }
        }
        return ret;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/GetBeanInterceptor.java [43:61]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
                              Object ret) throws Throwable {
        if (ret instanceof EnhancedInstance) {
            ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
            if (requestAttributes != null) {
                ContextManager.getRuntimeContext()
                              .put(
                                  REQUEST_KEY_IN_RUNTIME_CONTEXT,
                                  requestAttributes.getRequest()
                              );
                ContextManager.getRuntimeContext()
                              .put(
                                  RESPONSE_KEY_IN_RUNTIME_CONTEXT,
                                  requestAttributes.getResponse()
                              );
            }
        }
        return ret;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



