THsHaServer.Args args = new THsHaServer.Args(socket);
args.workerThreads(64);
args.protocolFactory(new TBinaryProtocol.Factory());
final ServiceHandler service_handler = new ServiceHandler(data);
args.processor(new Nimbus.Processor<Iface>(service_handler));
final THsHaServer server = new THsHaServer(args);
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
service_handler.shutdown();
scheduExec.shutdown();
server.stop();
}
});
LOG.info("Starting BlueWhale server...");
server.serve();
}