Package org.webbitserver.helpers

Examples of org.webbitserver.helpers.NamingThreadFactory


    private int maxHeaderSize = 8192;
    private int maxChunkSize = 8192;
    private int maxContentLength = 65536;

    public NettyWebServer(int port) {
        this(Executors.newSingleThreadScheduledExecutor(new NamingThreadFactory("WEBBIT-HANDLER-THREAD")), port);
    }
View Full Code Here


                        return pipeline;
                    }
                });

                staleConnectionTrackingHandler = new StaleConnectionTrackingHandler(staleConnectionTimeout, executor);
                ScheduledExecutorService staleCheckExecutor = Executors.newSingleThreadScheduledExecutor(new NamingThreadFactory("WEBBIT-STALE-CONNECTION-CHECK-THREAD"));
                staleCheckExecutor.scheduleWithFixedDelay(new Runnable() {
                    @Override
                    public void run() {
                        staleConnectionTrackingHandler.closeStaleConnections();
                    }
                }, staleConnectionTimeout / 2, staleConnectionTimeout / 2, TimeUnit.MILLISECONDS);
                executorServices.add(staleCheckExecutor);

                connectionTrackingHandler = new ConnectionTrackingHandler();
                ExecutorService bossExecutor = Executors.newSingleThreadExecutor(new NamingThreadFactory("WEBBIT-BOSS-THREAD"));
                executorServices.add(bossExecutor);
                ExecutorService workerExecutor = Executors.newSingleThreadExecutor(new NamingThreadFactory("WEBBIT-WORKER-THREAD"));
                executorServices.add(workerExecutor);
                bootstrap.setFactory(new NioServerSocketChannelFactory(bossExecutor, workerExecutor, 1));
                channel = bootstrap.bind(socketAddress);
                return NettyWebServer.this;
            }
View Full Code Here

TOP

Related Classes of org.webbitserver.helpers.NamingThreadFactory

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.