/** Processes the servlet request. * @param pRequest The servlet request being read. * @param pResponse The servlet response being created. * @throws IOException Reading the request or writing the response failed. * @throws ServletException Processing the request failed. */ public void execute(HttpServletRequest pRequest, HttpServletResponse pResponse) throws ServletException, IOException { XmlRpcHttpRequestConfigImpl config = getConfig(pRequest); ServletStreamConnection ssc = newStreamConnection(pRequest, pResponse); try { super.execute(config, ssc); } catch (XmlRpcException e) { throw new ServletException(e); } }
protected OutputStream getOutputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection, int pSize) throws IOException { if (pSize != -1) { ((ServletStreamConnection) pConnection).getResponse().setContentLength(pSize); } return super.getOutputStream(pConfig, pConnection, pSize); }
protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException { if (pConfig.isEnabledForExtensions() && pConfig.isGzipRequesting()) { setResponseHeader(pConnection, "Content-Encoding", "gzip"); } return super.getOutputStream(pConnection, pConfig, pStream); } }
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) throws XmlRpcException { RequestData data = (RequestData) pConfig; try { if (data.isByteArrayRequired()) { super.writeResponse(pConfig, pStream, pResult); data.getConnection().writeResponse(data, pStream); } else { data.getConnection().writeResponseHeader(data, -1); super.writeResponse(pConfig, pStream, pResult); pStream.flush(); } } catch (IOException e) { throw new XmlRpcException(e.getMessage(), e); } }
protected void writeError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Throwable pError) throws XmlRpcException { RequestData data = (RequestData) pConfig; try { if (data.isByteArrayRequired()) { super.writeError(pConfig, pStream, pError); data.getConnection().writeError(data, pError, (ByteArrayOutputStream) pStream); } else { data.getConnection().writeErrorHeader(data, pError, -1); super.writeError(pConfig, pStream, pError); pStream.flush(); } } catch (IOException e) { throw new XmlRpcException(e.getMessage(), e); } }
protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException { if (pConfig.isEnabledForExtensions() && pConfig.isGzipRequesting()) { setResponseHeader(pConnection, "Content-Encoding", "gzip"); } return super.getOutputStream(pConnection, pConfig, pStream); } }
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) throws XmlRpcException { RequestData data = (RequestData) pConfig; try { if (data.isByteArrayRequired()) { super.writeResponse(pConfig, pStream, pResult); data.getConnection().writeResponse(data, pStream); } else { data.getConnection().writeResponseHeader(data, -1); super.writeResponse(pConfig, pStream, pResult); pStream.flush(); } } catch (IOException e) { throw new XmlRpcException(e.getMessage(), e); } }
protected void writeError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Throwable pError) throws XmlRpcException { RequestData data = (RequestData) pConfig; try { if (data.isByteArrayRequired()) { super.writeError(pConfig, pStream, pError); data.getConnection().writeError(data, pError, (ByteArrayOutputStream) pStream); } else { data.getConnection().writeErrorHeader(data, pError, -1); super.writeError(pConfig, pStream, pError); pStream.flush(); } } catch (IOException e) { throw new XmlRpcException(e.getMessage(), e); } }
protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException { if (pConfig.isEnabledForExtensions() && pConfig.isGzipRequesting()) { setResponseHeader(pConnection, "Content-Encoding", "gzip"); } return super.getOutputStream(pConnection, pConfig, pStream); } }
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) throws XmlRpcException { RequestData data = (RequestData) pConfig; try { if (data.isByteArrayRequired()) { super.writeResponse(pConfig, pStream, pResult); data.getConnection().writeResponse(data, pStream); } else { data.getConnection().writeResponseHeader(data, -1); super.writeResponse(pConfig, pStream, pResult); pStream.flush(); } } catch (IOException e) { throw new XmlRpcException(e.getMessage(), e); } }
protected void writeError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Throwable pError) throws XmlRpcException { RequestData data = (RequestData) pConfig; try { if (data.isByteArrayRequired()) { super.writeError(pConfig, pStream, pError); data.getConnection().writeError(data, pError, (ByteArrayOutputStream) pStream); } else { data.getConnection().writeErrorHeader(data, pError, -1); super.writeError(pConfig, pStream, pError); pStream.flush(); } } catch (IOException e) { throw new XmlRpcException(e.getMessage(), e); } }
protected OutputStream getOutputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection, int pSize) throws IOException { if (pSize != -1) { ((ServletStreamConnection) pConnection).getResponse().setContentLength(pSize); } return super.getOutputStream(pConfig, pConnection, pSize); }
/** Processes the servlet request. * @param pRequest The servlet request being read. * @param pResponse The servlet response being created. * @throws IOException Reading the request or writing the response failed. * @throws ServletException Processing the request failed. */ public void execute(HttpServletRequest pRequest, HttpServletResponse pResponse) throws ServletException, IOException { XmlRpcHttpRequestConfigImpl config = getConfig(pRequest); ServletStreamConnection ssc = newStreamConnection(pRequest, pResponse); try { super.execute(config, ssc); } catch (XmlRpcException e) { throw new ServletException(e); } }