use of org.infinispan.notifications.cachelistener.annotation.TransactionCompleted in project infinispan by infinispan.
the class RemoteClusterListener method transactionCompleted.
@TransactionCompleted
public CompletionStage<Void> transactionCompleted(TransactionCompletedEvent event) {
GlobalTransaction transaction = event.getGlobalTransaction();
Queue<CacheEntryEvent> events = transactionChanges.remove(transaction);
if (event.isTransactionSuccessful() && events != null) {
List<ClusterEvent> eventsToSend = new ArrayList<>(events.size());
for (CacheEntryEvent cacheEvent : events) {
eventsToSend.add(ClusterEvent.fromEvent(cacheEvent));
// Send event back to origin who has the cluster listener
if (log.isTraceEnabled()) {
log.tracef("Passing Event(s) to manager %s to send to %s", eventsToSend, origin);
}
}
eventManager.addEvents(transaction, origin, id, eventsToSend, sync);
}
return CompletableFutures.completedNull();
}
Aggregations