TxInvocationContext txInvocationContext, Object localResult) {
if (txInvocationContext.isOriginLocal()) {
final CacheTransaction cacheTransaction = txInvocationContext.getCacheTransaction();
for (Response response : responseMap.values()) {
if (response != null && response.isSuccessful()) {
SuccessfulResponse sr = (SuccessfulResponse) response;
EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
if (uv != null) {
cacheTransaction.setUpdatedEntryVersions(uv.merge(cacheTransaction.getUpdatedEntryVersions()));
}
}
}
return localResult;
} else {
EntryVersionsMap mergeResult = localResult instanceof EntryVersionsMap ? (EntryVersionsMap) localResult :
new EntryVersionsMap();
for (Response response : responseMap.values()) {
if (response != null && response.isSuccessful()) {
SuccessfulResponse sr = (SuccessfulResponse) response;
EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
if (uv != null) {
mergeResult = mergeResult.merge(uv);
}
}
}