Examples of HashedWheelTimer


Examples of org.jboss.netty.util.HashedWheelTimer

    }

    @Override
    protected void doStart() throws Exception {
        if (timer == null) {
            HashedWheelTimer hashedWheelTimer = new HashedWheelTimer();
            hashedWheelTimer.start();
            timer = hashedWheelTimer;
        }

        if (configuration == null) {
            configuration = new NettyConfiguration();
View Full Code Here

Examples of org.jboss.netty.util.HashedWheelTimer

    }

    @Override
    protected void doStart() throws Exception {
        if (timer == null) {
            timer = new HashedWheelTimer();
        }

        if (configuration == null) {
            configuration = new NettyConfiguration();
        }
View Full Code Here

Examples of org.jboss.netty.util.HashedWheelTimer

    /**
     * Creates a new boss pool.
     */
    BossPool build() {
        return new NioClientBossPool(Executors.newCachedThreadPool(), bossCount, new HashedWheelTimer(), new CamelNettyThreadNameDeterminer(pattern, name));
    }
View Full Code Here

Examples of org.jboss.netty.util.HashedWheelTimer

    ThreadFactoryBuilder builder = new ThreadFactoryBuilder();
    ThreadFactory bossFactory = builder.setNameFormat(name + " Boss #%d").build();
    ThreadFactory workerFactory = builder.setNameFormat(name + " Worker #%d").build();

    NioClientBossPool bossPool = new NioClientBossPool(Executors.newCachedThreadPool(bossFactory), 1,
        new HashedWheelTimer(), ThreadNameDeterminer.CURRENT);
    NioWorkerPool workerPool = new NioWorkerPool(Executors.newCachedThreadPool(workerFactory), workerNum,
        ThreadNameDeterminer.CURRENT);

    return new NioClientSocketChannelFactory(bossPool, workerPool);
  }
View Full Code Here

Examples of org.jboss.netty.util.HashedWheelTimer

        this(processor, new ThriftServerConfig());
    }

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

Examples of org.jboss.netty.util.HashedWheelTimer

    // Configure the event pipeline factory.
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline p = Channels.pipeline();
        timer = new HashedWheelTimer();
        p.addLast("frameDecoder", new NettyFrameDecoder());
        p.addLast("frameEncoder", new NettyFrameEncoder());
        p.addLast("handler", new NettyClientWaspHandler());
        p.addLast(
            "readTimeout",
View Full Code Here

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

Examples of org.jboss.netty.util.HashedWheelTimer

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

Examples of org.jboss.netty.util.HashedWheelTimer

    /** 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

Examples of org.jboss.netty.util.HashedWheelTimer

    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
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.