in disco-java-agent-web/src/main/java/software/amazon/disco/agent/web/apache/httpclient/ApacheHttpClientInterceptor.java [69:104]
public static Object intercept(@AllArguments final Object[] args,
@Origin final String origin,
@SuperCall final Callable<Object> zuper) throws Throwable {
if (LogManager.isDebugEnabled()) {
log.debug("DiSCo(Web) interception of " + origin);
}
if (METHOD_INTERCEPTION_COUNTER.hasIntercepted()) {
return call(zuper);
}
HttpRequestAccessor requestAccessor = findRequestObject(args);
// publish request event
ServiceDownstreamRequestEvent requestEvent = publishRequestEvent(requestAccessor);
Throwable throwable = null;
Object response = null;
try {
response = call(zuper);
} catch (Throwable t) {
throwable = t;
} finally {
// publish response event
HttpResponseAccessor responseAccessor = null;
//we currently do not support the flavors of execute() which take a ResponseHandler<T> and return the T.
if (response instanceof HttpResponseAccessor) {
responseAccessor = (HttpResponseAccessor)response;
}
publishResponseEvent(responseAccessor, requestEvent, throwable);
if (throwable != null) {
throw throwable;
}
return response;
}
}