Search in sources :

Example 1 with XSiteAsyncAckListener

use of org.infinispan.remoting.transport.XSiteAsyncAckListener in project infinispan by infinispan.

the class JGroupsBackupResponse method notifyAsyncAck.

@Override
public void notifyAsyncAck(XSiteAsyncAckListener listener) {
    XSiteAsyncAckListener nonNullListener = Objects.requireNonNull(listener);
    for (Map.Entry<XSiteBackup, CompletableFuture<ValidResponse>> entry : backupCalls.entrySet()) {
        XSiteBackup backup = entry.getKey();
        if (backup.isSync()) {
            continue;
        }
        // TODO whenCompleteAsync? currently not needed...
        entry.getValue().whenComplete((response, throwable) -> nonNullListener.onAckReceived(sendTimeNanos, backup.getSiteName(), throwable));
    }
}
Also used : XSiteBackup(org.infinispan.xsite.XSiteBackup) CompletableFuture(java.util.concurrent.CompletableFuture) XSiteAsyncAckListener(org.infinispan.remoting.transport.XSiteAsyncAckListener) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 XSiteAsyncAckListener (org.infinispan.remoting.transport.XSiteAsyncAckListener)1 XSiteBackup (org.infinispan.xsite.XSiteBackup)1