boolean replaceStatus = false;
try {
replaceStatus = replaceOp.get();
} catch (InterruptedException e) {
replaceOp.set(false, new OperationStatus(false, "Replace get timed out"));
} catch (ExecutionException e) {
if(e.getCause() instanceof CancellationException) {
replaceOp.set(false, new OperationStatus(false, "Replace get "
+ "cancellation exception "));
} else {
replaceOp.set(false, new OperationStatus(false, "Replace get "
+ "execution exception "));
}
}
if (!replaceStatus) {
return replaceOp;
}
try {
observePoll(key, replaceOp.getCas(), req, rep, false);
replaceOp.set(true, replaceOp.getStatus());
} catch (ObservedException e) {
replaceOp.set(false, new OperationStatus(false, e.getMessage()));
} catch (ObservedTimeoutException e) {
replaceOp.set(false, new OperationStatus(false, e.getMessage()));
} catch (ObservedModifiedException e) {
replaceOp.set(false, new OperationStatus(false, e.getMessage()));
}
return replaceOp;
}