new TimeoutException("Operation did not complete before shutdown"));
}
}
// Close all active and idle Channels
final TimeoutRunnable afterClose = new TimeoutRunnable(
_scheduler, deadline - System.currentTimeMillis(), TimeUnit.MILLISECONDS, new Runnable()
{
@Override
public void run()
{
_state.set(State.SHUTDOWN);
LOG.info("Shutdown complete");
callback.onSuccess(None.none());
}
}, "Timed out waiting for channels to close, continuing shutdown");
ChannelGroupFuture future = _allChannels.close();
future.addListener(new ChannelGroupFutureListener()
{
@Override
public void operationComplete(ChannelGroupFuture channelGroupFuture) throws Exception
{
if (!channelGroupFuture.isCompleteSuccess())
{
LOG.warn("Failed to close some connections, ignoring");
}
afterClose.run();
}
});
}
@Override