@Override @SuppressWarnings("MagicNumber") public void failure(final Throwable error) { try { if (!grizzlyResponse.isCommitted()) { try { if (configSetStatusOverSendError) { grizzlyResponse.reset(); grizzlyResponse.setStatus(500, "Request failed."); } else { grizzlyResponse.sendError(500, "Request failed."); } } catch (final IllegalStateException ex) { // a race condition externally committing the response can still occur... logger.log(Level.FINER, "Unable to reset failed response.", ex); } catch (final IOException ex) { throw new ContainerException( LocalizationMessages.EXCEPTION_SENDING_ERROR_RESPONSE(500, "Request failed."), ex); } } } finally { logger.debugLog("{0} - failure(...) called", name); rethrow(error); } }
/** * Clear any content written to the buffer. * * @exception IllegalStateException if this response has already * been committed */ public void reset() { if (included) return; // Ignore any call from an included servlet coyoteResponse.reset(); outputBuffer.reset(); // reset Grizzly duplicated internal attributes coyoteResponse.resetBuffer(true); usingOutputStream = false; usingWriter = false; isCharacterEncodingSet = false; }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * {@inheritDoc} */ @Override public void reset() { if (isCommitted()) throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed."); response.reset(); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * {@inheritDoc} */ @Override public void reset() { if (isCommitted()) throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed."); response.reset(); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * {@inheritDoc} */ @Override public void reset() { if (isCommitted()) throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed."); response.reset(); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * {@inheritDoc} */ @Override public void reset() { if (isCommitted()) throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed."); response.reset(); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * {@inheritDoc} */ @Override public void reset() { if (isCommitted()) throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed."); response.reset(); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
/** * {@inheritDoc} */ @Override public void reset() { if (isCommitted()) throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed."); response.reset(); }
/** * Reset this response, and specify the values for the HTTP status code * and corresponding message. * * @exception IllegalStateException if this response has already been * committed */ public void reset(final int status, final String message) { reset(); setStatus(status, message); }
@Override @SuppressWarnings("MagicNumber") public void failure(final Throwable error) { try { if (!grizzlyResponse.isCommitted()) { try { if (configSetStatusOverSendError) { grizzlyResponse.reset(); grizzlyResponse.setStatus(500, "Request failed."); } else { grizzlyResponse.sendError(500, "Request failed."); } } catch (final IllegalStateException ex) { // a race condition externally committing the response can still occur... logger.log(Level.FINER, "Unable to reset failed response.", ex); } catch (final IOException ex) { throw new ContainerException( LocalizationMessages.EXCEPTION_SENDING_ERROR_RESPONSE(500, "Request failed."), ex); } } } finally { logger.debugLog("{0} - failure(...) called", name); rethrow(error); } }