@Override public String getName() { if (fieldDescriptors == null || fieldDescriptors.length == 0) { return getClass().getSimpleName() + "[" + (remoteService != null ? remoteService.toString() : "?") + "]"; } else { String fieldDescriptorNames = "["; fieldDescriptorNames += fieldDescriptors[0].getName(); for (int i = 1; i < fieldDescriptors.length; ++i) { fieldDescriptorNames += ", " + fieldDescriptors[i].getName(); } fieldDescriptorNames += "]"; return getClass().getSimpleName() + "[" + remoteService.toString() + "]" + fieldDescriptorNames; } }
/** * Method prints a class instance representation. * * @return the class string representation. */ @Override public String toString() { try { return getClass().getSimpleName() + "[scope:" + ScopeGenerator.generateStringRep(scope) + "]"; } catch (CouldNotPerformException ex) { try { return getClass().getSimpleName() + "[id:" + getId() + "]"; } catch (CouldNotPerformException exx) { return super.toString(); } } } }
/** * {@inheritDoc} * * @throws CouldNotPerformException {@inheritDoc} * @throws InterruptedException {@inheritDoc} */ @Override public void waitForData() throws CouldNotPerformException, InterruptedException { try { if (isDataAvailable()) { return; } logger.debug("Wait for " + this.toString() + " data..."); getDataFuture().get(); dataObservable.waitForValue(); } catch (ExecutionException | CancellationException ex) { throw new CouldNotPerformException("Could not wait for data!", ex); } }