}
try {
host.sendAsync(receiverUrl, request, agent,
null);
} catch (final IOException e1) {
throw new JSONRPCException(
CODE.REMOTE_EXCEPTION, "", e1);
}
JSONResponse response;
try {
response = callback.get();
} catch (final Exception e) {
throw new JSONRPCException(
CODE.REMOTE_EXCEPTION, "", e);
}
final JSONRPCException err = response.getError();
if (err != null) {
throw err;
} else if (response.getResult() != null
&& !method.getReturnType()
.equals(Void.TYPE)) {