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);