@Override
    public void before(Object target, Object[] args) {
        if (isDebug) {
            logger.beforeInterceptor(target, args);
        }

        if (!validate(target)) {
            return;
        }

        final InterceptorScopeInvocation currentTransaction = this.scope.getCurrentInvocation();
        if (currentTransaction == null) {
            return;
        }

        final Object attachment = currentTransaction.getAttachment();
        if (attachment instanceof ThriftClientCallContext) {
            ThriftClientCallContext clientCallContext = (ThriftClientCallContext) attachment;
            try {
                if (traceContext.currentRawTraceObject() != null) {
                    // duplicate trace.
                    return;
                }

                // Check if there is an active trace first for cases such as TServlet, which one of the WAS plugins would
                // have created one already.
                ThriftRequestProperty parentTraceInfo = clientCallContext.getTraceHeader();
                this.logger.debug("parentTraceInfo : {}", parentTraceInfo);

                final String methodUri = toMethodUri(clientCallContext);
                final Trace trace = createTrace(target, parentTraceInfo, methodUri);
                clientCallContext.setEntryPoint(true);
                if (trace == null) {
                    return;
                }

                if (!initScope(trace)) {
                    // invalid scope.
                    deleteTrace(trace);
                    return;
                }
                entryScope(trace);

                if (!trace.canSampled()) {
                    return;
                }

                SpanEventRecorder recorder = trace.traceBlockBegin();
                recorder.recordServiceType(ThriftConstants.THRIFT_SERVER_INTERNAL);
                if (methodUri != null) {
                    recorder.recordAttribute(ThriftConstants.THRIFT_URL, methodUri);
                }
            } catch (Throwable t) {
                logger.warn("Error creating trace object. Cause:{}", t.getMessage(), t);
            }
        }
    }
This interceptor intercepts the point in which the client message is read, and creates a new trace object to indicate the starting point of a new span.
<ul>
<li>Synchronous
<p>
<tt>TBaseProcessorProcessInterceptor</tt> -> <tt>ProcessFunctionProcessInterceptor</tt> -> <tt>TProtocolReadFieldBeginInterceptor</tt> <->
<tt>TProtocolReadTTypeInterceptor</tt> -> <b><tt>TProtocolReadMessageEndInterceptor</tt></b></li>
<li>Asynchronous
<p>
<tt>TBaseAsyncProcessorProcessInterceptor</tt> -> <tt>TProtocolReadMessageBeginInterceptor</tt> -> <tt>TProtocolReadFieldBeginInterceptor</tt> <->
<tt>TProtocolReadTTypeInterceptor</tt> -> <b><tt>TProtocolReadMessageEndInterceptor</tt></b>
</ul>
<p>
Based on Thrift 0.8.0+

@author HyunGil Jeong
@see com.navercorp.pinpoint.plugin.thrift.interceptor.server.TBaseProcessorProcessInterceptor TBaseProcessorProcessInterceptor
@see com.navercorp.pinpoint.plugin.thrift.interceptor.server.ProcessFunctionProcessInterceptor ProcessFunctionProcessInterceptor
@see com.navercorp.pinpoint.plugin.thrift.interceptor.server.async.TBaseAsyncProcessorProcessInterceptor TBaseAsyncProcessProcessInterceptor
@see com.navercorp.pinpoint.plugin.thrift.interceptor.tprotocol.server.TProtocolReadMessageBeginInterceptor TProtocolReadMessageBeginInterceptor
@see com.navercorp.pinpoint.plugin.thrift.interceptor.tprotocol.server.TProtocolReadFieldBeginInterceptor TProtocolReadFieldBeginInterceptor
@see com.navercorp.pinpoint.plugin.thrift.interceptor.tprotocol.server.TProtocolReadTTypeInterceptor TProtocolReadTTypeInterceptor
agent-module/plugins/thrift/src/main/java/com/navercorp/pinpoint/plugin/thrift/interceptor/tprotocol/server/TProtocolReadMessageEndInterceptor.java