@Test public void testProcessingRenderingWithErrors() throws IOException, InterruptedException { StringDataList dataList = createDataList(); dataList.request().errors().add(new ErrorMessage("m1","d1")); dataList.request().errors().add(new ErrorMessage("m2","d2")); assertThat(render(dataList), equalTo("{\"errors\":[" + "\"m1: d1\"," + "\"m2: d2\"" + "]," + "\"datalist\":[" + "{\"data\":\"l1\"}," + "{\"datalist\":[" + "{\"data\":\"l11\"}," + "{\"data\":\"l12\"}" + "]}" + "]}")); }
@Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } AsynchronousSectionedRenderer();  AsynchronousSectionedRenderer(Executor executor); }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } AsynchronousSectionedRenderer();  AsynchronousSectionedRenderer(Executor executor); abstract void beginResponse(OutputStream stream); abstract void beginList(DataList<?> list); abstract void data(Data data); abstract void endList(DataList<?> list); abstract void endResponse(); @Override final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response,
                                                  Execution execution, Request request); @Override void deconstruct(); final ListenableFuture<Boolean> renderBeforeHandover(OutputStream stream, RESPONSE response,
                                                                Execution execution, Request request); Execution getExecution(); Response getResponse(); int getRecursionLevel(); @Override final void setNetworkWiring(ContentChannel channel, CompletionHandler completionHandler); @Override void init(); }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } AsynchronousSectionedRenderer();  AsynchronousSectionedRenderer(Executor executor); abstract void beginResponse(OutputStream stream); abstract void beginList(DataList<?> list); abstract void data(Data data); abstract void endList(DataList<?> list); abstract void endResponse(); @Override final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response,
                                                  Execution execution, Request request); @Override void deconstruct(); final ListenableFuture<Boolean> renderBeforeHandover(OutputStream stream, RESPONSE response,
                                                                Execution execution, Request request); Execution getExecution(); Response getResponse(); int getRecursionLevel(); @Override final void setNetworkWiring(ContentChannel channel, CompletionHandler completionHandler); @Override void init();  }