if (multicast) {
if (trace) log.tracef("Invalidating keys %s via multicast", keys);
final InvalidateCommand ic = commandsFactory.buildInvalidateFromL1Command(
origin, false, InfinispanCollections.<Flag>emptySet(), keys);
if (useNotifyingFuture) {
NotifyingNotifiableFuture<Object> future = new AggregatingNotifyingFutureImpl(retval, 2);
rpcManager.invokeRemotelyInFuture(null, ic, rpcManager.getDefaultRpcOptions(true), future);
return future;
} else {
return asyncTransportExecutor.submit(new Callable<Object>() {
@Override
public Object call() throws Exception {
rpcManager.invokeRemotely(null, ic, rpcManager.getDefaultRpcOptions(true));
return retval;
}
});
}
} else {
final CacheRpcCommand rpc = commandsFactory.buildSingleRpcCommand(
commandsFactory.buildInvalidateFromL1Command(origin, false,
InfinispanCollections.<Flag>emptySet(), keys));
// Ask the caches who have requested from us to remove
if (trace) log.tracef("Keys %s needs invalidation on %s", keys, invalidationAddresses);
if (useNotifyingFuture) {
NotifyingNotifiableFuture<Object> future = new AggregatingNotifyingFutureImpl(retval, 2);
rpcManager.invokeRemotelyInFuture(invalidationAddresses, rpc, syncIgnoreLeaversRpcOptions, future);
return future;
} else {
return asyncTransportExecutor.submit(new Callable<Object>() {
@Override