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 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 be null)
        timeout - the remaining transaction timeout, or 0 if the default should be used
        doNotImport - true to indicate that a non-existing transaction should not be imported, false otherwise
        Returns:
        the transaction import result, or null if (and only if) doNotImport is true and 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, null is returned. Normally the transaction is located only by global ID.
        Parameters:
        xid - the XID to search for (must not be null)
        Returns:
        the transaction object, or null if 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:
        commit in interface XARecoverable
        Parameters:
        xid - the transaction ID (must not be null)
        onePhase - true to perform prepare and commit in one operation, false otherwise
        Throws:
        XAException - if the operation fails for some reason
      • forget

        void forget​(Xid xid)
             throws XAException
        Forget an imported, prepared transaction.
        Specified by:
        forget in interface XARecoverable
        Parameters:
        xid - the transaction ID (must not be null)
        Throws:
        XAException - if the operation fails for some reason