use of com.nr.agent.instrumentation.weblogic12.ResponseWrapper in project newrelic-java-agent by newrelic.
the class WebAppServletContext method execute.
@Trace(dispatcher = true)
void execute(ServletRequestImpl req, ServletResponseImpl rsp) {
HttpServletRequest request = getHttpServletRequest(req);
if (!AgentBridge.getAgent().getTransaction().isWebRequestSet()) {
if (request != null) {
AgentBridge.getAgent().getTransaction().setWebRequest(new RequestWrapper(request));
}
}
if (!AgentBridge.getAgent().getTransaction().isWebResponseSet()) {
if (req != null) {
AgentBridge.getAgent().getTransaction().setWebResponse(new ResponseWrapper(req.getResponse()));
}
}
Weaver.callOriginal();
if (request != null) {
Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");
if (exception != null) {
NewRelic.noticeError(exception);
}
}
if (request != null && request.isAsyncStarted()) {
AsyncContext asyncContext = request.getAsyncContext();
if (asyncContext != null) {
AgentBridge.asyncApi.suspendAsync(asyncContext);
}
}
AgentBridge.getAgent().getTransaction().addOutboundResponseHeaders();
AgentBridge.getAgent().getTransaction().markResponseSent();
}
Aggregations