Examples of IOEventDispatch


Examples of org.apache.http.nio.reactor.IOEventDispatch

        return new DefaultServerIODispatch(serviceHandler, params);
    }

    @Test
    public void testEndpointUpAndDown() throws Exception {
        final IOEventDispatch eventDispatch = createIOEventDispatch();
        IOReactorConfig config = new IOReactorConfig();
        config.setIoThreadCount(1);
        final ListeningIOReactor ioreactor = new DefaultListeningIOReactor(config);

        Thread t = new Thread(new Runnable() {
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

        Assert.assertEquals(IOReactorStatus.SHUT_DOWN, ioreactor.getStatus());
    }

    @Test
    public void testEndpointAlreadyBoundFatal() throws Exception {
        final IOEventDispatch eventDispatch = createIOEventDispatch();
        IOReactorConfig config = new IOReactorConfig();
        config.setIoThreadCount(1);
        final ListeningIOReactor ioreactor = new DefaultListeningIOReactor(config);

        final CountDownLatch latch = new CountDownLatch(1);
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

        Assert.assertEquals(IOReactorStatus.SHUT_DOWN, ioreactor.getStatus());
    }

    @Test
    public void testEndpointAlreadyBoundNonFatal() throws Exception {
        final IOEventDispatch eventDispatch = createIOEventDispatch();
        IOReactorConfig config = new IOReactorConfig();
        config.setIoThreadCount(1);
        final DefaultListeningIOReactor ioreactor = new DefaultListeningIOReactor(config);

        ioreactor.setExceptionHandler(new IOReactorExceptionHandler() {
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

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

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

Examples of org.apache.http.nio.reactor.IOEventDispatch

            log.error("Error starting the IOReactor", e);
        }

        metrics = new NhttpMetricsCollector(false, sslContext != null);
        handler = new ClientHandler(cfgCtx, params, metrics);
        final IOEventDispatch ioEventDispatch = getEventDispatch(
            handler, sslContext, sslIOSessionHandler, params, transportOut);

        // start the Sender in a new seperate thread
        Thread t = new Thread(new Runnable() {
            public void run() {
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

        for (Object obj : cfgCtx.getAxisConfiguration().getServices().values()) {
            addToServiceURIMap((AxisService) obj);
        }

        handler = new ServerHandler(listenerContext);
        final IOEventDispatch ioEventDispatch = getEventDispatch(handler,
                sslContext, sslIOSessionHandler, params);
        state = BaseConstants.STARTED;

        listenerContext.getHttpGetRequestProcessor().init(cfgCtx, handler);
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

    @Override
    public void run() {
        try {
            if (null == _ioReactor) {
                final IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(_handler, _params);
                _ioReactor = new DefaultListeningIOReactor(_workerCount,
                        _params);
                try {
                    _ioReactor.listen(new InetSocketAddress(_port));
                    _ioReactor.execute(ioEventDispatch);
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

                httpproc,
                new MyHttpRequestExecutionHandler(),
                new DefaultConnectionReuseStrategy(),
                params);
        handler.setEventListener(new EventLogger());
        final IOEventDispatch ioEventDispatch = new DefaultClientIOEventDispatch(handler, params);
        runner = new Thread(new Runnable() {
            public void run() {
                try {
                    ioReactor.execute(ioEventDispatch);
                } catch (InterruptedIOException ex) {
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

    public synchronized void setupNIOClient() throws IOReactorException {
        if (connectionManager != null) {
            return;
        }
        // Create client-side I/O reactor
        final IOEventDispatch ioEventDispatch = new DefaultHttpClientIODispatch(new HttpAsyncRequestExecutor(),
                                                                                new BasicHttpParams());
        ioReactor = new DefaultConnectingIOReactor(config);
       

        // Run the I/O reactor in a separate thread
View Full Code Here

Examples of org.apache.http.nio.reactor.IOEventDispatch

    public synchronized void setupNIOClient() throws IOReactorException {
        if (connectionManager != null) {
            return;
        }
        // Create client-side I/O reactor
        final IOEventDispatch ioEventDispatch = new DefaultHttpClientIODispatch(new HttpAsyncRequestExecutor(),
                                                                                new BasicHttpParams());
        ioReactor = new DefaultConnectingIOReactor(config);
       

        // Run the I/O reactor in a separate thread
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.