Search in sources :

Example 1 with ExtendedResponse

use of com.newrelic.api.agent.ExtendedResponse in project newrelic-java-agent by newrelic.

the class CrossProcessTransactionStateImpl method writeResponseHeaders.

@Override
public void writeResponseHeaders() {
    if (tx.isIgnore()) {
        return;
    }
    Dispatcher dispatcher = tx.getDispatcher();
    if (dispatcher == null) {
        return;
    }
    try {
        Response response = dispatcher.getResponse();
        long contentLength = -1;
        if (response instanceof ExtendedResponse) {
            contentLength = ((ExtendedResponse) response).getContentLength();
        } else {
            contentLength = tx.getInboundHeaderState().getRequestContentLength();
        }
        processOutboundResponseHeaders(response, contentLength);
    } catch (Throwable e) {
        Agent.LOG.log(Level.FINEST, e, "Error attempting to write response headers in transaction: {0}", tx);
    }
}
Also used : ExtendedResponse(com.newrelic.api.agent.ExtendedResponse) Response(com.newrelic.api.agent.Response) ExtendedResponse(com.newrelic.api.agent.ExtendedResponse) Dispatcher(com.newrelic.agent.dispatchers.Dispatcher)

Aggregations

Dispatcher (com.newrelic.agent.dispatchers.Dispatcher)1 ExtendedResponse (com.newrelic.api.agent.ExtendedResponse)1 Response (com.newrelic.api.agent.Response)1