@Override
public Object respond(Message message, Object request)
throws IOException {
assertTrue("w".equals(message.getName()));
GenericRecord inParams = (GenericRecord)request;
Integer currentCount = (Integer) inParams.get("req");
assertTrue(currentCount.equals(1));
GenericRecord paramsC = new GenericData.Record(
protocol.getMessages().get("x").getRequest());
paramsC.put("req", currentCount + 1);
Integer returnC = (Integer) reqC.request("x", paramsC);
assertTrue(returnC.equals(currentCount + 2));
GenericRecord paramsD = new GenericData.Record(
protocol.getMessages().get("x").getRequest());
paramsD.put("req", currentCount + 3);
Integer returnD = (Integer) reqD.request("x", paramsD);
assertTrue(returnD.equals(currentCount + 4));
return currentCount + 5;
}