ThriftServiceProcessor processor =
new ThriftServiceProcessor(codecManager,
ImmutableList.<ThriftEventHandler>of(),
exampleServiceHandler,
fb303Handler);
final ThriftServer server =
new ThriftServer(
processor,
config,
new NiftyTimer("thrift"),
ImmutableMap.<String, ThriftFrameCodecFactory>of("header", new HeaderThriftCodecFactory()),
ImmutableMap.<String, TDuplexProtocolFactory>of("header", new TDuplexHeaderProtocolFactory()),
ImmutableMap.<String, ExecutorService>of(),
new NiftyNoOpSecurityFactory());
fb303Handler.setShutdownHandler(new ServerShutdownHandler(server));
server.start();
}