+
+
+ protected ListenableFuture<DOMRpcResult> perfomRequestWithTimeout(String operation, ListenableFuture<DOMRpcResult> future) {
+ try {
+ future.get(defaultRequestTimeoutMillis, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("{}: {} failed with error", operation, id, e);
+ return Futures.immediateFailedCheckedFuture(new RuntimeException(id + ": " + operation + " failed"));
+ } catch (TimeoutException e) {
+ LOG.warn("{}: Unable to {} after {} milliseconds", id, operation, defaultRequestTimeoutMillis, e);
+ return Futures.immediateFailedCheckedFuture(new SchemaSourceException(e.getMessage()));
+ }
+ return future;
+ }