@Override public final void produce(final DataStreamChannel channel) throws IOException { final AsyncResponseProducer responseProducer = responseProducerRef.get(); if (responseProducer == null) { exchangeHandler.produce(channel); } else { responseProducer.produce(channel); } }
void produceOutput() throws HttpException, IOException { switch (responseState) { case BODY: exchangeHandler.produce(internalDataChannel); break; } }
void produceOutput() throws HttpException, IOException { switch (responseState) { case BODY: exchangeHandler.produce(internalDataChannel); break; } }
@Override public final void produce(final DataStreamChannel channel) throws IOException { final AsyncResponseProducer responseProducer = responseProducerRef.get(); if (responseProducer == null) { handler.produce(channel); } else { responseProducer.produce(channel); } }
@Override public final void produce(final DataStreamChannel channel) throws IOException { final AsyncResponseProducer responseProducer = responseProducerRef.get(); if (responseProducer == null) { handler.produce(channel); } else { responseProducer.produce(channel); } }
@Override public void produceOutput() throws HttpException, IOException { if (responseState == MessageState.BODY) { Asserts.notNull(exchangeHandler, "Exchange handler"); exchangeHandler.produce(dataChannel); } }
private void commitResponse( final HttpResponse response, final EntityDetails responseEntityDetails) throws HttpException, IOException { if (responseCommitted.compareAndSet(false, true)) { final int status = response.getCode(); if (status < HttpStatus.SC_SUCCESS) { throw new HttpException("Invalid response: " + status); } context.setAttribute(HttpCoreContext.HTTP_RESPONSE, response); httpProcessor.process(response, responseEntityDetails, context); final List<Header> responseHeaders = DefaultH2ResponseConverter.INSTANCE.convert(response); Asserts.notNull(receivedRequest, "Received request"); final String method = receivedRequest.getMethod(); final boolean endStream = responseEntityDetails == null || method.equalsIgnoreCase("HEAD"); outputChannel.submit(responseHeaders, endStream); connMetrics.incrementResponseCount(); if (responseEntityDetails == null) { responseState = MessageState.COMPLETE; } else { responseState = MessageState.BODY; exchangeHandler.produce(outputChannel); } } else { throw new H2ConnectionException(H2Error.INTERNAL_ERROR, "Response already committed"); } }
} else { responseState = MessageState.BODY; exchangeHandler.produce(internalDataChannel);
} else { responseState = MessageState.BODY; exchangeHandler.produce(internalDataChannel);