@PreDestroy
void stop() {
Future<?> listenersFuture = this.listeners.shutdownGracefully();
Future<?> workersFuture = this.workers.shutdownGracefully();
listenersFuture.addListener(new FutureListener() {
@Override
public void operationComplete(Future future) throws Exception {
if (future.isSuccess()) {
log.info("Listeners are shut down");
} else {
log.catching(future.cause());
}
}
});
workersFuture.addListener(new FutureListener() {
@Override
public void operationComplete(Future future) throws Exception {
if (future.isSuccess()) {
log.info("Workers are shut down");
} else {