MasterMonitorInfo info = null;
try {
final SendMonitorInfoEvent event = sendSlaveMonitorInfoEvent;
if(logger.isInfoEnabled()) {
logger.info("Trying to send monitor info to master");
}
responseQueue.put(sendSlaveMonitorInfoEvent.getSequence(), sendSlaveMonitorInfoEvent);
Channel channel = getChannel(leaderChannel);
sendSlaveMonitorInfoEvent.setChannel(channel);
ChannelFuture channelFuture = channel.write(sendSlaveMonitorInfoEvent);
channelFuture.addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture future) {
if (!future.isSuccess()) {
responseQueue.remove(event.getSequence());
logger.error("Slavesocket write error when trying to get tasks from master.", future.getCause());
future.getChannel().close();
}
}
});