Package org.wildfly.transaction.client
Interface XAImporter
-
- All Superinterfaces:
XARecoverable
public interface XAImporter extends XARecoverable
The API which must be implemented by transaction providers that support transaction inflow.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcommit(Xid xid, boolean onePhase)Commit an imported (typically prepared) transaction.jakarta.transaction.TransactionfindExistingTransaction(Xid xid)Find an existing transaction on this system.ImportResult<?>findOrImportTransaction(Xid xid, int timeout, boolean doNotImport)Import a transaction.voidforget(Xid xid)Forget an imported, prepared transaction.Xid[]recover(int flag, String parentName)Initiate a recovery scan.-
Methods inherited from interface org.wildfly.transaction.client.XARecoverable
recover
-
-
-
-
Method Detail
-
findOrImportTransaction
ImportResult<?> findOrImportTransaction(Xid xid, int timeout, boolean doNotImport) throws XAException
Import a transaction. If the transaction already exists, it should be returned, otherwise a new transaction should be initiated with the given timeout (in seconds).- Parameters:
xid- the transaction ID (must not benull)timeout- the remaining transaction timeout, or 0 if the default should be useddoNotImport-trueto indicate that a non-existing transaction should not be imported,falseotherwise- Returns:
- the transaction import result, or
nullif (and only if)doNotImportistrueand the transaction didn't exist locally - Throws:
XAException- if the import failed for some reason
-
findExistingTransaction
jakarta.transaction.Transaction findExistingTransaction(Xid xid) throws XAException
Find an existing transaction on this system. If no such transaction exists,nullis returned. Normally the transaction is located only by global ID.- Parameters:
xid- the XID to search for (must not benull)- Returns:
- the transaction object, or
nullif the transaction is not known - Throws:
XAException- if the transaction manager failed for some reason
-
commit
void commit(Xid xid, boolean onePhase) throws XAException
Commit an imported (typically prepared) transaction.- Specified by:
commitin interfaceXARecoverable- Parameters:
xid- the transaction ID (must not benull)onePhase-trueto perform prepare and commit in one operation,falseotherwise- Throws:
XAException- if the operation fails for some reason
-
forget
void forget(Xid xid) throws XAException
Forget an imported, prepared transaction.- Specified by:
forgetin interfaceXARecoverable- Parameters:
xid- the transaction ID (must not benull)- Throws:
XAException- if the operation fails for some reason
-
recover
@NotNull Xid[] recover(int flag, String parentName) throws XAException
Initiate a recovery scan.- Specified by:
recoverin interfaceXARecoverable- Parameters:
flag- one ofXAResource.TMSTARTRSCAN,XAResource.TMNOFLAGS, orXAResource.TMENDRSCANparentName- the name of the node to recover on behalf of, ornullfor all- Returns:
- the array of recovered XIDs (may be
SimpleXid.NO_XIDS, must not benull) - Throws:
XAException- if the operation fails for some reason
-
-