Package org.jboss.netty.util

Examples of org.jboss.netty.util.HashedWheelTimer


        this.requestFilters = ImmutableList.copyOf(requestFilters);

        String namePrefix = "http-client-" + name;

        // shared timer for channel factory and read timeout channel handler
        this.timer = new HashedWheelTimer(daemonThreadsNamed(namePrefix + "-timer-%s"));

        ChannelFactory channelFactory = new NioClientSocketChannelFactory(ioPool.getBossPool(), ioPool.getWorkerPool());

        ThreadFactory workerThreadFactory = daemonThreadsNamed(namePrefix + "-worker-%s");
        this.executor = new OrderedMemoryAwareThreadPoolExecutor(asyncConfig.getWorkerThreads(), 0, 0, 30, TimeUnit.SECONDS, workerThreadFactory);
View Full Code Here


    this.password = password;
    this.executor = exec;
   
    this.proxySettings = proxy;

    timer = new HashedWheelTimer();
   
    channelFactory = new NioClientSocketChannelFactory(
        executor, 1, new NioWorkerPool(executor, DEFAULT_IO_THREADS), timer);

    boot = new ClientBootstrap(channelFactory);
View Full Code Here

     *        the {@link WorkerPool} to use to do the IO
     */
    public NioClientSocketChannelFactory(
            Executor bossExecutor, int bossCount,
            WorkerPool<NioWorker> workerPool) {
        this(bossExecutor, bossCount, workerPool, new HashedWheelTimer());
    }
View Full Code Here

     *
     * @param bossExecutor  the Executor to use for server the {@link NioClientBoss}
     * @param bossCount     the number of {@link NioClientBoss} instances this {@link NioClientBoss} will hold
     */
    public NioClientBossPool(Executor bossExecutor, int bossCount) {
        this(bossExecutor, bossCount, new HashedWheelTimer(), null);
        stopTimer = true;
    }
View Full Code Here

    this.password = password;
    this.executor = exec;
   
    this.proxySettings = proxy;

    timer = new HashedWheelTimer();
   
    channelFactory = new NioClientSocketChannelFactory(
        executor, 1, new NioWorkerPool(executor, DEFAULT_IO_THREADS), timer);

    boot = new ClientBootstrap(channelFactory);
View Full Code Here

     */
    @Override
    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = Channels.pipeline();

        pipeline.addLast("readTimeout", new ReadTimeoutHandler(new HashedWheelTimer(),
                                                               conf.getReadTimeout()));
        pipeline.addLast("lengthbasedframedecoder", new LengthFieldBasedFrameDecoder(MAX_FRAME_LENGTH, 0, 4, 0, 4));
        pipeline.addLast("mainhandler", this);
        return pipeline;
    }
View Full Code Here

        );
    }

    private Timer buildDefaultTimer()
    {
        return new HashedWheelTimer(renamingDaemonThreadFactory(threadNamePattern("-timer-%s")));
    }
View Full Code Here

        serverTransport = new NettyServerTransport(serverDef,
                                                   new NettyServerConfigBuilder()
                                                       .setBossThreadCount(bossThreadCount)
                                                       .setWorkerThreadCount(workerThreadCount)
                                                       .setTimer(new HashedWheelTimer())
                                                       .build(),
                                                   new DefaultChannelGroup());
        serverTransport.start();
    }
View Full Code Here

    protected ChannelPipelineFactory createPipelineFactory(final ChannelGroup group) {
       
        return new ChannelPipelineFactory() {
           
            private final ChannelGroupHandler groupHandler = new ChannelGroupHandler(group);
            private final HashedWheelTimer timer = new HashedWheelTimer();
           
            private final TimeUnit TIMEOUT_UNIT = TimeUnit.SECONDS;

            public ChannelPipeline getPipeline() throws Exception {
                ChannelPipeline pipeline = pipeline();
View Full Code Here

        bootstrap.setOption("remoteAddress", addr);

        setDefaultTimeout(60, TimeUnit.SECONDS);

        channels = new DefaultChannelGroup();
        timer    = new HashedWheelTimer();
    }
View Full Code Here

TOP

Related Classes of org.jboss.netty.util.HashedWheelTimer

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.