public InternalCacheEntry retrieveFromRemoteSource(Object key, InvocationContext ctx) throws Exception { ClusteredGetCommand get = cf.buildClusteredGetCommand(key, ctx.getFlags()); List<Address> targets = locate(key); targets.remove(getSelf()); ResponseFilter filter = new ClusteredGetResponseValidityFilter(targets); Map<Address, Response> responses = rpcManager.invokeRemotely( targets, get, ResponseMode.SYNCHRONOUS, configuration.getSyncReplTimeout(), false, filter); if (!responses.isEmpty()) { for (Response r : responses.values()) { if (r instanceof SuccessfulResponse) { InternalCacheValue cacheValue = (InternalCacheValue) ((SuccessfulResponse) r).getResponseValue(); return cacheValue.toInternalCacheEntry(key); } } } return null; }
@Override public ClusteredGetCommand buildClusteredGetCommand( Object key, Set<Flag> flags, boolean acquireRemoteLock, GlobalTransaction gtx) { return actual.buildClusteredGetCommand(key, flags, acquireRemoteLock, gtx); }