public void resume(){ completionHandler.resumed(attachment); try{ response.sendHeaders(); response.flush(); response.finish(); } catch (IOException ex){ LoggerUtils.getLogger().log(Level.FINEST,"resume",ex); } }
public void resume() { invokeCompletionHandler(); try { response.sendHeaders(); response.flush(); response.finish(); } catch (IOException ex) { if (LoggerUtils.getLogger().isLoggable(Level.FINE)) { LoggerUtils.getLogger().log(Level.FINEST, "resume", ex); } } }
public void afterService(Request req, Response res) throws Exception { if (res.getStatus() == 404 && !commitErrorResponse){ return; } try{ req.action( ActionCode.ACTION_POST_REQUEST , null); }catch (Throwable t) { logger.log(Level.WARNING,"afterService()",t); } res.finish(); req.recycle(); res.recycle(); }
/** * Finish the {@link Response} and recycle the {@link Request} and the * {@link Response}. If the {@link StaticResourcesAdapter#commitErrorResponse} * is set to false, this method does nothing. * * @param req {@link Request} * @param res {@link Response} * @throws java.lang.Exception */ public void afterService(Request req, Response res) throws Exception { if (res.getStatus() == 404 && !commitErrorResponse){ return; } try{ req.action( ActionCode.ACTION_POST_REQUEST , null); }catch (Throwable t) { logger.log(Level.WARNING,"afterService unexpected exception: ",t); } res.finish(); req.recycle(); res.recycle(); }
/** * Finish the {@link Response} and recycle the {@link Request} and the * {@link Response}. If the {@link StaticResourcesAdapter#commitErrorResponse} * is set to false, this method does nothing. * * @param req {@link Request} * @param res {@link Response} * @throws Exception */ public void afterService(Request req, Response res) throws Exception { if (req.getNote(14) != null) { req.setNote(14, null); return; } if (res.getStatus() == 404 && !commitErrorResponse) { return; } try { req.action(ActionCode.ACTION_POST_REQUEST, null); } catch (Throwable t) { logger.log(Level.WARNING, "afterService unexpected exception: ", t); } res.finish(); }
public void timeout(boolean forceClose){ // If the buffers are empty, commit the response header try{ completionHandler.cancelled(attachment); } finally { if (forceClose &&!response.isCommitted()){ try{ response.sendHeaders(); response.flush(); response.finish(); } catch (IOException ex){ // Swallow? } } } }
/** * Method will be called to notify about async HTTP processing timeout * @return <tt>true</tt>, if async processing has been finished, or <tt>false</tt> * if we should re-register the channel to continue async HTTP request processing */ public boolean timeout() { // If the buffers are empty, commit the response header try { cancel(); } finally { if (!response.isCommitted()) { try { response.sendHeaders(); response.flush(); response.finish(); } catch (IOException ex) { // Swallow? } } } return true; }
/** * Close the output buffer. This tries to calculate the response size if * the response has not been committed yet. * * @throws IOException An underlying IOException occurred */ public void close() throws IOException { if (closed) return; if (suspended) return; if ((!coyoteResponse.isCommitted()) && (coyoteResponse.getContentLength() == -1)) { // Flushing the char buffer if (state == CHAR_STATE) { cb.flushBuffer(); state = BYTE_STATE; } // If this didn't cause a commit of the response, the final content // length can be calculated if (!coyoteResponse.isCommitted()) { coyoteResponse.setContentLength(bb.getLength()); } } doFlush(false); closed = true; coyoteResponse.finish(); }
/** * Close the output buffer. This tries to calculate the response size if * the response has not been committed yet. * * @throws IOException An underlying IOException occurred */ public void close() throws IOException { if (closed) return; if (suspended) return; if ((!response.isCommitted()) && (response.getContentLength() == -1)) { // Flushing the char buffer if (state == CHAR_STATE) { cb.flushBuffer(); state = BYTE_STATE; } // If this didn't cause a commit of the response, the final content // length can be calculated if (!response.isCommitted()) { response.setContentLength(bb.getLength()); } } doFlush(false); closed = true; response.finish(); }
/** * Close the output buffer. This tries to calculate the response size if * the response has not been committed yet. * * @throws IOException An underlying IOException occurred */ public void close() throws IOException { if (closed) return; if (suspended) return; if ((!coyoteResponse.isCommitted()) && (coyoteResponse.getContentLength() == -1)) { // Flushing the char buffer if (state == CHAR_STATE) { cb.flushBuffer(); state = BYTE_STATE; } // If this didn't cause a commit of the response, the final content // length can be calculated if (!coyoteResponse.isCommitted()) { coyoteResponse.setContentLength(bb.getLength()); } } doFlush(false); closed = true; coyoteResponse.finish(); }