protocol = new BinaryNodeStateProtocol(NameIdPair.NOCHECK,
repNode.getRepImpl());
try {
channel.configureBlocking(true);
BinaryNodeStateRequest msg =
protocol.read(channel, BinaryNodeStateRequest.class);
/*
* Response a protocol error if the group name doesn't
* match.
*/
final String groupName = msg.getGroupName();
if (!repNode.getGroup().getName().equals(groupName) ||
!repNode.getNodeName().equals(msg.getNodeName())) {
throw new ProtocolException("Sending the request to" +
" a wrong group or a wrong node.");
}
/* Write the response the requested node. */