else if (wait) {
queue.poll(TimeUnit.MILLISECONDS, getLongPollTimeout(), new OutputStreamWriteAdapter(outputStream));
outputStream.close();
}
else {
queue.poll(new OutputStreamWriteAdapter(outputStream));
outputStream.close();
}
}
catch (final Throwable t) {
writeExceptionToOutputStream(httpServletResponse, t);