final SyncCallback<JSONResponse> callback = new SyncCallback<JSONResponse>();
try {
sender.send(request, receiverUrl, callback, 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)) {
return TypeUtil.inject(response.getResult(),