}
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
throws Exception {
SlaveNodeEvent slaveEvent = (SlaveNodeEvent)e.getMessage();
if (slaveEvent != null)
{
if(SlaveEventCode.GET_TASK_RESP.equals(slaveEvent.getEventCode())) {
slaveNode.addEvent(slaveEvent);
}
if (responseQueue.containsKey(slaveEvent.getSequence()))
{
responseQueue.get(slaveEvent.getSequence()).setResponse(slaveEvent);
responseQueue.get(slaveEvent.getSequence()).getResultReadyFlag().countDown();
// if(!slaveEventTimeQueue.remove(responseQueue.get(slaveEvent.getSequence())))
// logger.error("event not in timeout queue, please check code,maybe it be wrong!");
responseQueue.remove(slaveEvent.getSequence());
}
else
logger.error("receive invalidate response,sequence :" + slaveEvent.getSequence());
}
}