Examples of HttpRequestHandler


Examples of org.apache.http.protocol.HttpRequestHandler

     *            then it will return an RFC2616 compliant deflate encoded zlib stream.
     * @return a non-null {@link HttpRequestHandler}
     */
    private HttpRequestHandler createDeflateEncodingRequestHandler(
            final String entityText, final boolean rfc1951) {
        return new HttpRequestHandler() {

            /**
             * {@inheritDoc}
             */
            public void handle(
View Full Code Here

Examples of org.apache.http.protocol.HttpRequestHandler

     * @param entityText
     *            the non-null String entity to be returned by the server
     * @return a non-null {@link HttpRequestHandler}
     */
    private HttpRequestHandler createGzipEncodingRequestHandler(final String entityText) {
        return new HttpRequestHandler() {

            /**
             * {@inheritDoc}
             */
            public void handle(
View Full Code Here

Examples of org.apache.http.protocol.HttpRequestHandler

        try {

            this.httpProcessor.process(request, context);

            HttpRequestHandler handler = null;
            if (handlerResolver != null) {
                String requestURI = request.getRequestLine().getUri();
                handler = handlerResolver.lookup(requestURI);
            }
            if (handler != null) {
                if (handler instanceof AsyncHttpRequestHandler) {
                    ((AsyncHttpRequestHandler)handler).handle(request, context, new AsyncResponseHandler() {
                        public void sendResponse(HttpResponse response) throws IOException, HttpException {
                            try {
                                AsyncBufferingHttpServiceHandler.this.sendResponse(conn, response);
                            } catch (HttpException ex) {
                                response = AsyncBufferingHttpServiceHandler.this.responseFactory.newHttpResponse(
                                    HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR, conn.getContext());
                                response.setParams(AsyncBufferingHttpServiceHandler.this.params);
                                AsyncBufferingHttpServiceHandler.this.handleException(ex, response);
                                AsyncBufferingHttpServiceHandler.this.sendResponse(conn, response);
                            }
                        }
                    });
                } else { // just hanlder the request with sync request handler
                    HttpResponse response = this.responseFactory.newHttpResponse(
                        ver, HttpStatus.SC_OK, conn.getContext());
                    response.setParams(this.params);
                    context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);
                    handler.handle(request, response, context);
                    sendResponse(conn, response);
                }
            } else {
                // add the default handler here
                HttpResponse response = this.responseFactory.newHttpResponse(
View Full Code Here

Examples of org.apache.http.protocol.HttpRequestHandler

        try {

            this.httpProcessor.process(request, context);

            HttpRequestHandler handler = null;
            if (this.handlerResolver != null) {
                String requestURI = request.getRequestLine().getUri();
                handler = this.handlerResolver.lookup(requestURI);
            }
            if (handler != null) {
                handler.handle(request, response, context);
            } else {
                response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);
            }

        } catch (HttpException ex) {
View Full Code Here

Examples of org.chiba.web.servlet.HttpRequestHandler

        }
    }

    protected HttpRequestHandler getHttpRequestHandler() {
        if (this.httpRequestHandler == null) {
            this.httpRequestHandler = new HttpRequestHandler(this.chibaBean);
            this.httpRequestHandler.setUploadRoot(this.uploadDestination);
            this.httpRequestHandler.setSessionKey(this.xformsSession.getKey());
        }

        return this.httpRequestHandler;
View Full Code Here

Examples of org.jboss.netty.example.http.snoop.HttpRequestHandler

    private void switchToHttp(ChannelHandlerContext ctx) {
        ChannelPipeline p = ctx.getPipeline();
        p.addLast("decoder", new HttpRequestDecoder());
        p.addLast("encoder", new HttpResponseEncoder());
        p.addLast("deflater", new HttpContentCompressor());
        p.addLast("handler", new HttpRequestHandler());
        p.remove(this);
    }
View Full Code Here

Examples of org.jolokia.http.HttpRequestHandler

        if (!context.endsWith("/")) {
            context += "/";
        }

        backendManager = new BackendManager(pConfig,this, createRestrictor(pConfig));
        requestHandler = new HttpRequestHandler(backendManager,this);
    }
View Full Code Here

Examples of org.owasp.proxy.http.server.HttpRequestHandler

        };
       
        ServerGroup sg = new ServerGroup();
        sg.addServer(mainListener);
        drh.setServerGroup(sg);
        HttpRequestHandler rh = drh;
        rh = new LoggingHttpRequestHandler(rh);

        BufferedMessageInterceptor bmi = setInterseptor();   
       
        rh = new BufferingHttpRequestHandler(rh, bmi, 10240);
View Full Code Here

Examples of org.springframework.web.HttpRequestHandler

    MockServletContext servletContext = new MockServletContext();
    final MockHttpServletRequest request = new MockHttpServletRequest();
    final MockHttpServletResponse response = new MockHttpServletResponse();

    StaticWebApplicationContext wac = new StaticWebApplicationContext();
    wac.getBeanFactory().registerSingleton("myHandler", new HttpRequestHandler() {
      public void handleRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        assertSame(request, req);
        assertSame(response, res);
        String exception = request.getParameter("exception");
        if ("ServletException".equals(exception)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.