s.close();
bootstrap = Guice.createInjector(Stage.PRODUCTION, new NiftyModule() {
@Override
protected void configureNifty() {
ThriftServerDefBuilder serverDefBuilder;
serverDefBuilder = new ThriftServerDefBuilder()
.listen(port)
.withProcessor(new scribe.Processor<>(new scribe.Iface() {
@Override
public ResultCode Log(List<LogEntry> messages)
throws TException {
for (LogEntry message : messages) {
log.info("{}: {}", message.getCategory(),
message.getMessage());
}
return ResultCode.OK;
}
}));
bind().toInstance(serverDefBuilder.build());
}
}).getInstance(NiftyBootstrap.class);
bootstrap.start();
}