final Call call = calls.remove(id);
final int state = in.readInt(); // read call status
if (state == Status.SUCCESS.state) {
IOReadableWritable value = null;
boolean isNotNull = in.readBoolean();
if (isNotNull) {
final String returnClassName = StringRecord.readString(in);
Class<? extends IOReadableWritable> c = null;
try {
c = ClassUtils.getRecordByName(returnClassName);
} catch (ClassNotFoundException e) {
LOG.error(e);
}
try {
value = c.newInstance();
} catch (InstantiationException e) {
LOG.error(e);
} catch (IllegalAccessException e) {
LOG.error(e);
}
value.read(in); // read value
}
call.setValue(value);
} else if (state == Status.ERROR.state) {
call.setException(new RemoteException(StringRecord.readString(in), StringRecord.readString(in)));
} else if (state == Status.FATAL.state) {