Package org.apache.http.impl.nio.reactor

Examples of org.apache.http.impl.nio.reactor.DefaultListeningIOReactor


       
        // configure the IO reactor on the specified port
        HttpParams params = listenerContext.getParams();
        try {
            String prefix = (sslContext == null ? "http" : "https") + "-Listener I/O dispatcher";
            ioReactor = new DefaultListeningIOReactor(
                NHttpConfiguration.getInstance().getServerIOWorkers(),               
                new NativeThreadFactory(new ThreadGroup(prefix + " thread group"), prefix), params);

            ioReactor.setExceptionHandler(new IOReactorExceptionHandler() {
                public boolean handle(IOException ioException) {
View Full Code Here


     * @param port port to start the listener on
     */
    private void startServerEngine(int port) {
        HttpParams params = getServerParameters();
        try {
            ioReactor = new DefaultListeningIOReactor(
                NHttpConfiguration.getInstance().getServerIOWorkers(), params);
        } catch (IOException e) {
            log.error("Error starting the IOReactor", e);
        }

View Full Code Here

            .setBooleanParameter(HttpConnectionParams.STALE_CONNECTION_CHECK, false)
            .setBooleanParameter(HttpConnectionParams.TCP_NODELAY, true)
            .setParameter(HttpProtocolParams.ORIGIN_SERVER, "TEST-SSL-SERVER/1.1");
       
        this.reqistry = new HttpRequestHandlerRegistry();
        this.ioReactor = new DefaultListeningIOReactor(2, this.params);
        this.mutex = new Object();
    }
View Full Code Here

            .setBooleanParameter(HttpConnectionParams.STALE_CONNECTION_CHECK, false)
            .setBooleanParameter(HttpConnectionParams.TCP_NODELAY, true)
            .setParameter(HttpProtocolParams.ORIGIN_SERVER, "TEST-SERVER/1.1");
       
        this.reqistry = new HttpRequestHandlerRegistry();
        this.ioReactor = new DefaultListeningIOReactor(2, this.params);
        this.mutex = new Object();
    }
View Full Code Here

        NHttpRequestHandlerRegistry reqistry = new NHttpRequestHandlerRegistry();
        reqistry.register("/rnd", new NRandomDataHandler());
        handler.setHandlerResolver(reqistry);

        ListeningIOReactor ioreactor = new DefaultListeningIOReactor(2, params);
        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
        this.listener = new NHttpListener(ioreactor, ioEventDispatch);
    }
View Full Code Here

   
    public TestHttpSSLServer(final HttpParams params) throws Exception {
        super();
        this.params = params;
        this.sslcontext = createSSLContext();
        this.ioReactor = new DefaultListeningIOReactor(2, this.params);
    }
View Full Code Here

                handler, params);

        try {
            output.append(Utils.getCurrentTimeToString() + ":开启服务器,端口:9999\n");
            output.setCaretPosition(output.getText().length());
            ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params);
            ioReactor.listen(new InetSocketAddress(port));
            ioReactor.execute(ioEventDispatch);
        } catch (InterruptedIOException ex) {
            System.err.println("Interrupted");
        } catch (IOException e) {
            System.err.println("I/O error: " + e.getMessage());
        }
View Full Code Here

     * @param port port to start the listener on
     */
    private void startServerEngine(int port) {
        HttpParams params = getServerParameters();
        try {
            ioReactor = new DefaultListeningIOReactor(
                NHttpConfiguration.getInstance().getServerIOWorkers(), params);
        } catch (IOException e) {
            log.error("Error starting the IOReactor", e);
        }

View Full Code Here

    private volatile IOReactorThread thread;
    private volatile InetSocketAddress address;
   
    public TestHttpServer(final HttpParams params) throws IOException {
        super();
        this.ioReactor = new DefaultListeningIOReactor(2, params);
        this.params = params;
        this.socketMutex = new Object();
    }
View Full Code Here

    private volatile InetSocketAddress address;
   
    public TestHttpSSLServer(final HttpParams params) throws Exception {
        super();
        this.params = params;
        this.ioReactor = new DefaultListeningIOReactor(2, this.params);
        this.socketMutex = new Object();
       
        ClassLoader cl = getClass().getClassLoader();
        URL url = cl.getResource("test.keystore");
        KeyStore keystore  = KeyStore.getInstance("jks");
View Full Code Here

TOP

Related Classes of org.apache.http.impl.nio.reactor.DefaultListeningIOReactor

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.