Package org.jboss.netty.util

Examples of org.jboss.netty.util.HashedWheelTimer


            ThriftServerDef def = ThriftServerDef.newBuilder()
                                                 .listen(0)
                                                 .withProcessor(processor)
                                                 .speaks(protocolFactory).build();

            server = new NettyServerTransport(def, new NettyConfigBuilder(), new DefaultChannelGroup(), new HashedWheelTimer());
            server.start();
        }
View Full Code Here


        );
    }

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

            NettyConfigBuilder configBuilder,
            ChannelGroup allChannels)
    {
        this.allChannels = allChannels;
        this.transports = new ArrayList<>();
        this.timer = new HashedWheelTimer();
        for (ThriftServerDef thriftServerDef : thriftServerDefs) {
            transports.add(new NettyServerTransport(thriftServerDef,
                                                    configBuilder,
                                                    allChannels,
                                                    timer));
View Full Code Here

            Executor worker) {
        this.queue = queue;
        this.remoteAddress = remoteAddress;
        this.boss = boss;
        this.worker = worker;
        this.timer = new HashedWheelTimer();
        connId = -1;
    }
View Full Code Here

        // Parse options.
        String host = args[0];
        int port = Integer.parseInt(args[1]);

        // Initialize the timer that schedules subsequent reconnection attempts.
        final Timer timer = new HashedWheelTimer();

        // Configure the client.
        final ClientBootstrap bootstrap = new ClientBootstrap(
                new NioClientSocketChannelFactory(
                        Executors.newCachedThreadPool(),
View Full Code Here

        this(processor, new ThriftServerConfig());
    }

    public ThriftServer(TProcessor processor, ThriftServerConfig config)
    {
        this(processor, config, new HashedWheelTimer());
    }
View Full Code Here

        this(processor, new ThriftServerConfig());
    }

    public ThriftServer(NiftyProcessor processor, ThriftServerConfig config)
    {
        this(processor, config, new HashedWheelTimer());
    }
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

public class ThriftServerModule implements Module
{
    @Override
    public void configure(Binder binder)
    {
        binder.bind(Timer.class).annotatedWith(ThriftServerTimer.class).toInstance(new HashedWheelTimer());

        newSetBinder(binder, ThriftServiceExport.class).permitDuplicates();
        newSetBinder(binder, ThriftEventHandler.class).permitDuplicates();
        binder.bind(ThriftServiceProcessor.class).toProvider(ThriftServiceProcessorProvider.class).in(Scopes.SINGLETON);
        binder.bind(NiftyProcessor.class).to(Key.get(ThriftServiceProcessor.class)).in(Scopes.SINGLETON);
View Full Code Here

        checkNotNull(config, "config is null");

        String prefix = "netty-client-" + name + "-io-";

        String nameFormat = prefix + "timer-%s";
        this.hashedWheelTimer = new HashedWheelTimer(daemonThreadsNamed(nameFormat));

        // Give netty infinite thread "sources" for worker and boss.
        // Netty will name the threads and will size the pool appropriately
        this.bossExecutor = newCachedThreadPool(daemonThreadsNamed(prefix + "boss-%s"));
        this.workerExecutor = newCachedThreadPool(daemonThreadsNamed(prefix + "worker-%s"));
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.