@Override
    public void beforeTrace(Trace trace, SpanEventRecorder recorder, Object target, Object[] args) {
        final HttpRequest httpRequest = getHttpRequest(target);
        if (httpRequest == null) {
            return;
        }
        final NameIntValuePair<String> host = getHost(target);
        // set remote trace
        final TraceId nextId = trace.getTraceId().getNextTraceId();
        recorder.recordNextSpanId(nextId.getSpanId());

        final String hostString = getHostString(host.getName(), host.getValue());
        this.requestTraceWriter.write(httpRequest, nextId, hostString);

        if (isAsynchronousInvocation(target, args)) {
            // set asynchronous trace
            final AsyncContext asyncContext = recorder.recordNextAsyncContext();
            // check type isAsynchronousInvocation()
            ((AsyncContextAccessor) ((ResultFutureGetter) target)._$PINPOINT$_getResultFuture())._$PINPOINT$_setAsyncContext(asyncContext);
            if (isDebug) {
                logger.debug("Set AsyncContext {}", asyncContext);
            }
        }
    }
@author minwoo.jung
@author jaehong.kim
agent-module/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/interceptor/DefaultClientExchangeHandlerImplStartMethodInterceptor.java