Search in sources :

Example 1 with MuleHttpConnectorResponse

use of com.nr.agent.instrumentation.mule3.MuleHttpConnectorResponse in project newrelic-java-agent by newrelic.

the class HttpResponseBuilder_Instrumentation method build.

@Trace(excludeFromTransactionTrace = true)
public HttpResponse build() {
    MuleHttpConnectorResponse response = new MuleHttpConnectorResponse(headers, responseStatus);
    NewRelic.getAgent().getTracedMethod().addOutboundRequestHeaders(response);
    final Transaction txn = AgentBridge.getAgent().getTransaction(false);
    if (txn != null) {
        txn.setWebResponse(response);
        long contentLength;
        try {
            contentLength = getContentLength(response);
        } catch (Exception e) {
            contentLength = -1L;
        }
        txn.getCrossProcessState().processOutboundResponseHeaders(response, contentLength);
    }
    return Weaver.callOriginal();
}
Also used : Transaction(com.newrelic.agent.bridge.Transaction) MuleHttpConnectorResponse(com.nr.agent.instrumentation.mule3.MuleHttpConnectorResponse) Trace(com.newrelic.api.agent.Trace)

Aggregations

Transaction (com.newrelic.agent.bridge.Transaction)1 Trace (com.newrelic.api.agent.Trace)1 MuleHttpConnectorResponse (com.nr.agent.instrumentation.mule3.MuleHttpConnectorResponse)1