org.infinispan.hotrod.impl.transaction.recovery.RecoveryManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-hotrod-jakarta Show documentation
Show all versions of infinispan-hotrod-jakarta Show documentation
Infinispan Hot Rod Client Jakarta EE
The newest version!
package org.infinispan.hotrod.impl.transaction.recovery;
import java.util.Collection;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ConcurrentHashMap;
import javax.transaction.xa.Xid;
/**
* It keeps the local in-doubt transactions.
*
* @since 14.0
*/
//TODO merge with org.infinispan.hotrod.impl.transaction.XaModeTransactionTable ?
public class RecoveryManager {
private final Collection preparedTransactions = ConcurrentHashMap.newKeySet();
public void addTransaction(Xid xid) {
preparedTransactions.add(xid);
}
public void forgetTransaction(Xid xid) {
preparedTransactions.remove(xid);
}
public RecoveryIterator startScan(CompletionStage> requestFuture) {
return new RecoveryIterator(preparedTransactions, requestFuture);
}
}