observeFuture.set(replaceStatus, future.getStatus());
if (future.getCas() != null) {
observeFuture.setCas(future.getCas());
}
} catch (InterruptedException e) {
observeFuture.set(false, new OperationStatus(false, prefix + " get "
+ "timed out"));
} catch (ExecutionException e) {
if(e.getCause() instanceof CancellationException) {
observeFuture.set(false, new OperationStatus(false, prefix + " get "
+ "cancellation exception "));
} else {
observeFuture.set(false, new OperationStatus(false, prefix + " get "
+ "execution exception "));
}
}
if (!replaceStatus) {
latch.countDown();
observeFuture.signalComplete();
return;
}
try {
observePoll(key, future.getCas(), req, rep, delete);
observeFuture.set(true, future.getStatus());
} catch (ObservedException e) {
observeFuture.set(false, new OperationStatus(false, e.getMessage()));
} catch (ObservedTimeoutException e) {
observeFuture.set(false, new OperationStatus(false, e.getMessage()));
} catch (ObservedModifiedException e) {
observeFuture.set(false, new OperationStatus(false, e.getMessage()));
}
latch.countDown();
observeFuture.signalComplete();
}