Search in sources :

Example 76 with ServletInputStream

use of javax.servlet.ServletInputStream in project tomee by apache.

the class ServerServlet method service.

protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    if (!activated) {
        response.getWriter().write("");
        return;
    }
    ServletInputStream in = request.getInputStream();
    ServletOutputStream out = response.getOutputStream();
    try {
        RequestInfos.initRequestInfo(request);
        ejbServer.service(in, out);
    } catch (ServiceException e) {
        throw new ServletException("ServerService error: " + ejbServer.getClass().getName() + " -- " + e.getMessage(), e);
    } finally {
        RequestInfos.clearRequestInfo();
    }
}
Also used : ServletException(javax.servlet.ServletException) ServletInputStream(javax.servlet.ServletInputStream) ServiceException(org.apache.openejb.server.ServiceException) ServletOutputStream(javax.servlet.ServletOutputStream)

Aggregations

ServletInputStream (javax.servlet.ServletInputStream)76 IOException (java.io.IOException)50 Test (org.junit.Test)43 HttpServletRequest (javax.servlet.http.HttpServletRequest)42 ServletException (javax.servlet.ServletException)41 HttpServletResponse (javax.servlet.http.HttpServletResponse)40 CountDownLatch (java.util.concurrent.CountDownLatch)26 HttpServlet (javax.servlet.http.HttpServlet)20 DeferredContentProvider (org.eclipse.jetty.client.util.DeferredContentProvider)20 InterruptedIOException (java.io.InterruptedIOException)18 AsyncContext (javax.servlet.AsyncContext)17 ReadListener (javax.servlet.ReadListener)17 ServletOutputStream (javax.servlet.ServletOutputStream)16 AbstractHandler (org.eclipse.jetty.server.handler.AbstractHandler)16 ContentResponse (org.eclipse.jetty.client.api.ContentResponse)15 Request (org.eclipse.jetty.server.Request)14 Response (org.eclipse.jetty.client.api.Response)9 ByteArrayOutputStream (java.io.ByteArrayOutputStream)8 PrintWriter (java.io.PrintWriter)8 Matchers.containsString (org.hamcrest.Matchers.containsString)8