if (!(isCacheReady() && isLocalCall())) return null;
ClusteredGetCommand clusteredGetCommand = new ClusteredGetCommand(key, cache.getName());
List<Response> response = doRemoteCall(clusteredGetCommand);
if (response.isEmpty()) return null;
if (response.size() > 1)
throw new CacheLoaderException("Response length is always 0 or 1, received: " + response);
Response firstResponse = response.get(0);
if (firstResponse.isSuccessful() && firstResponse instanceof SuccessfulResponse) {
return (InternalCacheEntry) ((SuccessfulResponse) firstResponse).getResponseValue();
}
String message = "Unknown response from remote cache: " + response;
log.error(message);
throw new CacheLoaderException(message);
}