use of com.navercorp.pinpoint.plugin.httpclient4.HttpCallContext in project pinpoint by naver.
the class HttpClientExecuteMethodInternalInterceptor method after.
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
if (isDebug) {
logger.afterInterceptor(target, target.getClass().getName(), "", "internal", args);
}
if (!needGetStatusCode()) {
return;
}
if (result != null && result instanceof HttpResponse) {
HttpResponse response = (HttpResponse) result;
if (response.getStatusLine() != null) {
HttpCallContext context = new HttpCallContext();
final StatusLine statusLine = response.getStatusLine();
if (statusLine != null) {
context.setStatusCode(statusLine.getStatusCode());
InterceptorScopeInvocation transaction = interceptorScope.getCurrentInvocation();
if (transaction != null && transaction.getAttachment() == null) {
transaction.setAttachment(context);
}
}
}
}
}
Aggregations