Package org.apache.http.nio.protocol

Examples of org.apache.http.nio.protocol.HttpAsyncRequestHandlerRegistry


        }
    }

    @Test
    public void testZeroCopyFallback() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BasicAsyncRequestHandler(new TestHandler(true)));
        HttpHost target = start(registry, null);
        File tmpdir = FileUtils.getTempDirectory();
        this.tmpfile = new File(tmpdir, "dst.test");
        TestZeroCopyPost httppost = new TestZeroCopyPost(target.toURI() + "/bounce", true);
        TestZeroCopyConsumer consumer = new TestZeroCopyConsumer(this.tmpfile);
View Full Code Here


        HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
        return target;
    }

    private HttpHost start() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("/echo/*", new BasicAsyncRequestHandler(new EchoHandler()));
        registry.register("/random/*", new BasicAsyncRequestHandler(new RandomHandler()));
        return start(registry, null);
    }
View Full Code Here

                new ResponseServer(),
                new ResponseContent(),
                new ResponseConnControl()
        });
        // Create request handler registry
        HttpAsyncRequestHandlerRegistry reqistry = new HttpAsyncRequestHandlerRegistry();
        // Register the default handler for all URIs
        reqistry.register("*", new HttpFileHandler(docRoot));
        // Create server-side HTTP protocol handler
        HttpAsyncServiceHandler protocolHandler = new HttpAsyncServiceHandler(
                reqistry, httpproc, new DefaultConnectionReuseStrategy(), params) {

            @Override
View Full Code Here

        ProxyConnPool connPool = new ProxyConnPool(connectingIOReactor, params);
        connPool.setMaxTotal(100);
        connPool.setDefaultMaxPerRoute(20);

        HttpAsyncRequestHandlerRegistry handlerRegistry = new HttpAsyncRequestHandlerRegistry();
        handlerRegistry.register("*", new ProxyRequestHandler(targetHost, executor, connPool));

        ProxyServiceHandler serviceHandler = new ProxyServiceHandler(
                handlerRegistry, inhttpproc, new ProxyIncomingConnectionReuseStrategy(), params);

        final IOEventDispatch connectingEventDispatch = new DefaultClientIODispatch(
View Full Code Here

    }

    @Test
    public void testTruncatedChunkException() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler(true)));
        HttpAsyncService serviceHandler = new HttpAsyncService(
                this.serverHttpProc,
                new DefaultConnectionReuseStrategy(),
                registry,
                this.serverParams);
View Full Code Here

    }

    @Test
    public void testIgnoreTruncatedChunkException() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler(true)));
        HttpAsyncService serviceHandler = new HttpAsyncService(
                this.serverHttpProc,
                new DefaultConnectionReuseStrategy(),
                registry,
                this.serverParams);
View Full Code Here

        return buffer.toString();
    }

    @Test
    public void testHttpGets() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        InetSocketAddress address = start(registry, null);

        this.connpool.setDefaultMaxPerRoute(3);
        this.connpool.setMaxTotal(3);

View Full Code Here

        }
    }

    @Test
    public void testHttpHeads() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        InetSocketAddress address = start(registry, null);

        this.connpool.setDefaultMaxPerRoute(3);
        this.connpool.setMaxTotal(3);

View Full Code Here

        }
    }

    @Test
    public void testHttpPostsWithContentLength() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        InetSocketAddress address = start(registry, null);

        this.connpool.setDefaultMaxPerRoute(3);
        this.connpool.setMaxTotal(3);

View Full Code Here

        }
    }

    @Test
    public void testHttpPostsChunked() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        InetSocketAddress address = start(registry, null);

        this.connpool.setDefaultMaxPerRoute(3);
        this.connpool.setMaxTotal(3);

View Full Code Here

TOP

Related Classes of org.apache.http.nio.protocol.HttpAsyncRequestHandlerRegistry

Copyright © 2018 www.massapicom. 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.