class SofaTracerMethodInvocationProcessor implements MethodInvocationProcessor {

    private final io.opentracing.Tracer tracer;

    public SofaTracerMethodInvocationProcessor(io.opentracing.Tracer tracer) {
        this.tracer = tracer;
    }

    @Override
    public Object process(MethodInvocation invocation, Tracer tracerSpan) throws Throwable {
        return proceedProxyMethodWithTracerAnnotation(invocation, tracerSpan);
    }

    private Object proceedProxyMethodWithTracerAnnotation(MethodInvocation invocation,
                                                          Tracer tracerSpan) throws Throwable {<FILL_FUNCTION_BODY>}

}

        if (tracer instanceof FlexibleTracer) {
            try {
                String operationName = tracerSpan.operateName();
                if (StringUtils.isBlank(operationName)) {
                    operationName = invocation.getMethod().getName();
                }
                SofaTracerSpan sofaTracerSpan = ((FlexibleTracer) tracer)
                    .beforeInvoke(operationName);
                sofaTracerSpan.setTag(CommonSpanTags.METHOD, invocation.getMethod().getName());
                if (invocation.getArguments().length != 0) {
                    StringBuilder stringBuilder = new StringBuilder();
                    for (Object obj : invocation.getArguments()) {
                        stringBuilder.append(obj.getClass().getName()).append(";");
                    }
                    sofaTracerSpan.setTag("param.types",
                        stringBuilder.substring(0, stringBuilder.length() - 1));
                }
                Object result = invocation.proceed();
                ((FlexibleTracer) tracer).afterInvoke();
                return result;
            } catch (Throwable t) {
                ((FlexibleTracer) tracer).afterInvoke(t.getMessage());
                throw t;
            }
        } else {
            return invocation.proceed();
        }
    
<no_super_class>