Package org.apache.http.impl.nio

Examples of org.apache.http.impl.nio.DefaultHttpServerIODispatch


        };
        // Create HTTP connection factory
        NHttpConnectionFactory<DefaultNHttpServerConnection> connFactory;
        connFactory = new DefaultNHttpServerConnectionFactory(params);
        // Create server-side I/O event dispatch
        final IOEventDispatch ioEventDispatch = new DefaultHttpServerIODispatch(protocolHandler, connFactory);
        // Create server-side I/O reactor
        new Thread(new Runnable(){
         
          @Override
          public void run() {
View Full Code Here


                inhttpproc, new ProxyIncomingConnectionReuseStrategy(), handlerRegistry, params);

        final IOEventDispatch connectingEventDispatch = new DefaultHttpClientIODispatch(
                clientHandler, params);

        final IOEventDispatch listeningEventDispatch = new DefaultHttpServerIODispatch(
                serviceHandler, params);

        Thread t = new Thread(new Runnable() {

            public void run() {
View Full Code Here

            connFactory = new SSLNHttpServerConnectionFactory(sslcontext, null, params);
        } else {
            connFactory = new DefaultNHttpServerConnectionFactory(params);
        }
        // Create server-side I/O event dispatch
        IOEventDispatch ioEventDispatch = new DefaultHttpServerIODispatch(protocolHandler, connFactory);
        // Create server-side I/O reactor
        ListeningIOReactor ioReactor = new DefaultListeningIOReactor();
        try {
            // Listen of the given port
            ioReactor.listen(new InetSocketAddress(port));
View Full Code Here

    }

    public void start() throws IOException {
        if (this.status.compareAndSet(Status.READY, Status.ACTIVE)) {
            this.endpoint = this.ioReactor.listen(new InetSocketAddress(this.ifAddress, this.port > 0 ? this.port : 0));
            final IOEventDispatch ioEventDispatch = new DefaultHttpServerIODispatch(
                    this.httpService, this.connectionFactory);
            this.listenerExecutorService.execute(new Runnable() {

                @Override
                public void run() {
View Full Code Here

                new ResponseContent(),
                new ResponseConnControl()
        });
        final HttpAsyncService serviceHandler = new HttpAsyncService(httpproc,
                new UriHttpAsyncRequestHandlerMapper());
        return new DefaultHttpServerIODispatch(serviceHandler, ConnectionConfig.DEFAULT);
    }
View Full Code Here

    public void setExceptionHandler(final IOReactorExceptionHandler exceptionHandler) {
        this.ioReactor.setExceptionHandler(exceptionHandler);
    }

    private void execute(final NHttpServerEventHandler serviceHandler) throws IOException {
        final IOEventDispatch ioEventDispatch = new DefaultHttpServerIODispatch(serviceHandler, this.connFactory) {

            @Override
            protected DefaultNHttpServerConnection createConnection(final IOSession session) {
                final DefaultNHttpServerConnection conn = super.createConnection(session);
                conn.setSocketTimeout(timeout);
View Full Code Here

                handlerRegistry);

        final IOEventDispatch connectingEventDispatch = new DefaultHttpClientIODispatch(
                clientHandler, ConnectionConfig.DEFAULT);

        final IOEventDispatch listeningEventDispatch = new DefaultHttpServerIODispatch(
                serviceHandler, ConnectionConfig.DEFAULT);

        Thread t = new Thread(new Runnable() {

            public void run() {
View Full Code Here

        } else {
            connFactory = new DefaultNHttpServerConnectionFactory(
                    ConnectionConfig.DEFAULT);
        }
        // Create server-side I/O event dispatch
        IOEventDispatch ioEventDispatch = new DefaultHttpServerIODispatch(protocolHandler, connFactory);
        // Set I/O reactor defaults
        IOReactorConfig config = IOReactorConfig.custom()
            .setIoThreadCount(1)
            .setSoTimeout(3000)
            .setConnectTimeout(3000)
View Full Code Here

                handlerRegistry);

        final IOEventDispatch connectingEventDispatch = new DefaultHttpClientIODispatch(
                clientHandler, ConnectionConfig.DEFAULT);

        final IOEventDispatch listeningEventDispatch = new DefaultHttpServerIODispatch(
                serviceHandler, ConnectionConfig.DEFAULT);

        Thread t = new Thread(new Runnable() {

            public void run() {
View Full Code Here

    public void setExceptionHandler(final IOReactorExceptionHandler exceptionHandler) {
        this.ioReactor.setExceptionHandler(exceptionHandler);
    }

    private void execute(final NHttpServerEventHandler serviceHandler) throws IOException {
        final IOEventDispatch ioEventDispatch = new DefaultHttpServerIODispatch(serviceHandler,
                this.connFactory);
        this.ioReactor.execute(ioEventDispatch);
    }
View Full Code Here

TOP

Related Classes of org.apache.http.impl.nio.DefaultHttpServerIODispatch

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.