Package org.jboss.netty.util

Examples of org.jboss.netty.util.HashedWheelTimer


  private final boolean _ownTimer;

  public ExtendedWriteTimeoutHandler(String name, Timer timer, long timeoutMs,
                                         boolean closeOnTimeout)
  {
    super((null != timer) ? timer : new HashedWheelTimer(timeoutMs, TimeUnit.MILLISECONDS, 10),
          timeoutMs, TimeUnit.MILLISECONDS);
    _name = name;
    _closeOnTimeout = closeOnTimeout;
    _ownTimer = (null == timer);
  }
View Full Code Here


      _timer = timer;
      _ownTimer = false;
    }
    else
    {
      _timer = new HashedWheelTimer(timeoutMs, TimeUnit.MILLISECONDS, 10);
      _ownTimer = true;
    }
  }
View Full Code Here

    /** Create new threadpools and timer **/
    public DatabusClientNettyThreadPools(int id)
    {
      // connection factory
      _timer = new HashedWheelTimer(5, TimeUnit.MILLISECONDS);
      _ioExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("io" + id ));
      _bossExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("boss" + id ));
      _channelGroup = new DefaultChannelGroup();
    }
View Full Code Here

    public DatabusClientNettyThreadPools(int id,
        Timer timer,
        ExecutorService bossExecutorService,
        ExecutorService ioExecutorService, ChannelGroup channelGroup)
    {
      _timer = (timer != null) ? timer :  new HashedWheelTimer(5, TimeUnit.MILLISECONDS);
      _bossExecutorService = (bossExecutorService != null) ? bossExecutorService : Executors.newCachedThreadPool(new NamedThreadFactory("io" + id));
      _ioExecutorService = (ioExecutorService != null) ? ioExecutorService : Executors.newCachedThreadPool(new NamedThreadFactory("boss" + id )) ;
      _channelGroup = (channelGroup != null) ?  channelGroup :  new DefaultChannelGroup() ;
    }
View Full Code Here

            channelPipeline.addLast("ssl", sslHandler);
        }

        // use read timeout handler to handle timeout while waiting for a remote reply (while reading from the remote host)
        if (producer.getConfiguration().getTimeout() > 0) {
            Timer timer = new HashedWheelTimer();
            channelPipeline.addLast("timeout", new ReadTimeoutHandler(timer, producer.getConfiguration().getTimeout(), TimeUnit.MILLISECONDS));
        }

        List<ChannelUpstreamHandler> decoders = producer.getConfiguration().getDecoders();
        for (int x = 0; x < decoders.size(); x++) {
View Full Code Here

        this(processor, new ThriftServerConfig());
    }

    public ThriftServer(TProcessor processor, ThriftServerConfig config)
    {
        this(processor, config, new HashedWheelTimer());
    }
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();
        binder.bind(ThriftServiceProcessor.class).toProvider(ThriftServiceProcessorProvider.class).in(Scopes.SINGLETON);
        binder.bind(TProcessor.class).to(Key.get(ThriftServiceProcessor.class)).in(Scopes.SINGLETON);
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

    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

            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

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.