public void outputReady(NHttpServerConnection conn, ContentEncoder encoder) {
AsyncHttpService httpService = (AsyncHttpService) conn.getContext()
.getAttribute(HTTP_ASYNC_SERVICE);
try {
httpService.produceContent(encoder);
} catch (IOException ex) {
httpService.shutdown(ex);
shutdownConnection(conn);
}
}