public final byte[] processAndRender(ComponentSpecification chainSpec,
                                         ComponentSpecification rendererSpec,
                                         REQUEST request) throws IOException {
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        Renderer<RESPONSE> renderer = getRenderer(rendererSpec);
        CompletableFuture<Boolean> renderTask = doProcessAndRender(chainSpec, request, renderer, stream);

        awaitFuture(renderTask);
        return stream.toByteArray();
    }
Processes the given request with the given chain, and returns the response.

@param chain the specification of the chain to execute
@param request the request to process
@return a response
application/src/main/java/com/yahoo/application/container/ProcessingBase.java