use of org.infinispan.remoting.responses.UnsuccessfulResponse in project infinispan by infinispan.
the class ScatteredDistributionInterceptor method handleWritePrimaryResponse.
private Object handleWritePrimaryResponse(InvocationContext ctx, DataWriteCommand command, Object rv) {
Response response = (Response) rv;
if (!response.isSuccessful()) {
command.fail();
if (response instanceof UnsuccessfulResponse) {
return ((UnsuccessfulResponse) response).getResponseValue();
} else {
throw new CacheException("Unexpected response " + response);
}
}
Object responseValue = ((SuccessfulResponse) response).getResponseValue();
try {
return command.acceptVisitor(ctx, new PrimaryResponseHandler(responseValue));
} catch (Throwable throwable) {
throw CompletableFutures.asCompletionException(throwable);
}
}
Aggregations