org.jboss.netty.channel.socket.ServerSocketChannelFactory Java Examples

The following examples show how to use org.jboss.netty.channel.socket.ServerSocketChannelFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RpcChannelFactory.java    From incubator-tajo with Apache License 2.0 6 votes vote down vote up
public static synchronized ServerSocketChannelFactory createServerChannelFactory(String name, int workerNum) {
  name = name + "-" + serverCount.incrementAndGet();
  if(LOG.isInfoEnabled()){
    LOG.info("Create " + name + " ServerSocketChannelFactory. Worker:" + workerNum);
  }
  ThreadFactoryBuilder builder = new ThreadFactoryBuilder();
  ThreadFactory bossFactory = builder.setNameFormat(name + " Server Boss #%d").build();
  ThreadFactory workerFactory = builder.setNameFormat(name + " Server Worker #%d").build();

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

  return new NioServerSocketChannelFactory(bossPool, workerPool);
}
 
Example #2
Source File: AbstractAsyncServer.java    From james-project with Apache License 2.0 4 votes vote down vote up
protected ServerSocketChannelFactory createSocketChannelFactory() {
    return new NioServerSocketChannelFactory(createBossExecutor(), createWorkerExecutor(), ioWorker);
}
 
Example #3
Source File: OioPOP3Server.java    From james-project with Apache License 2.0 4 votes vote down vote up
@Override
protected ServerSocketChannelFactory createSocketChannelFactory() {
    return new OioServerSocketChannelFactory(createBossExecutor(), createWorkerExecutor());
}
 
Example #4
Source File: OioIMAPServer.java    From james-project with Apache License 2.0 4 votes vote down vote up
@Override
protected ServerSocketChannelFactory createSocketChannelFactory() {
    return new OioServerSocketChannelFactory(createBossExecutor(), createWorkerExecutor());
}
 
Example #5
Source File: OioLMTPServer.java    From james-project with Apache License 2.0 4 votes vote down vote up
@Override
protected ServerSocketChannelFactory createSocketChannelFactory() {
    return new OioServerSocketChannelFactory(createBossExecutor(), createWorkerExecutor());
}
 
Example #6
Source File: OioSMTPServer.java    From james-project with Apache License 2.0 4 votes vote down vote up
@Override
protected ServerSocketChannelFactory createSocketChannelFactory() {
    return new OioServerSocketChannelFactory(createBossExecutor(), createWorkerExecutor());
}