Responder responder = new LilySpecificResponder(AvroLily.class, avroLily);
ThreadFactory threadFactory = new CustomThreadFactory("avro-exechandler", new ThreadGroup("AvroExecHandler"));
if (maxServerThreads == -1) {
executorService = Executors.newCachedThreadPool(threadFactory);
executionHandler = new ExecutionHandler(executorService);
} else {
executorService = new ThreadPoolExecutor(maxServerThreads / 3, maxServerThreads,
60, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), threadFactory, new WaitPolicy());
executionHandler = new ExecutionHandler(executorService);
}
//server = new HttpServer(responder, port);
server = new NettyServer(responder, new InetSocketAddress(port), new NioServerSocketChannelFactory
(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()), executionHandler);