use of isf.logic.ObjectWrapper in project isf-jclient by mikrohash.
the class NodeManager method getNodeInfo.
public static GetNodeInfoResponse getNodeInfo(final int parApi, boolean tryMultipleTimes) {
final ObjectWrapper api = new ObjectWrapper(parApi);
final ObjectWrapper res = new ObjectWrapper(null);
TimeAbortCall tb = new TimeAbortCall("requesting node info", 0) {
@Override
public boolean onCall() {
try {
res.o = apis[(int) api.o].getNodeInfo();
return true;
} catch (Throwable e) {
api.o = handleThrowableFromIotaAPI("receive getNodeInfo", e, (int) api.o);
return false;
}
}
};
do {
tb.call(NODEINFO_DURATION_TOLERANCE);
} while (tryMultipleTimes);
return (GetNodeInfoResponse) res.o;
}
Aggregations