Class JBossLocalTransactionProvider

    • Method Detail

      • createNewTransaction

        @NotNull
        public jakarta.transaction.Transaction createNewTransaction​(int timeout)
                                                             throws jakarta.transaction.SystemException,
                                                                    SecurityException
        Description copied from interface: LocalTransactionProvider
        Create and start a new local transaction, which is not associated with any particular thread.
        Specified by:
        createNewTransaction in interface LocalTransactionProvider
        Parameters:
        timeout - the timeout to use for the new transaction
        Returns:
        the new transaction (must not be null)
        Throws:
        jakarta.transaction.SystemException - if the creation of the transaction failed for some reason
        SecurityException - if the caller is not authorized to create a transaction
      • getXAResourceRegistry

        public XAResourceRegistry getXAResourceRegistry​(LocalTransaction transaction)
                                                 throws jakarta.transaction.SystemException
        Description copied from interface: LocalTransactionProvider
        Return the XAResource registry associated with transaction. If there is no such registry yet, one is created.
        Specified by:
        getXAResourceRegistry in interface LocalTransactionProvider
        Parameters:
        transaction - the transaction
        Returns:
        the registry associated with transaction. Can return null if this provider requires no XAResource registry
        Throws:
        jakarta.transaction.SystemException
      • isImported

        public boolean isImported​(@NotNull
                                  jakarta.transaction.Transaction transaction)
                           throws IllegalArgumentException
        Description copied from interface: LocalTransactionProvider
        Determine whether the given transaction was imported or originated locally.
        Specified by:
        isImported in interface LocalTransactionProvider
        Parameters:
        transaction - the transaction to test (not null)
        Returns:
        true if the transaction was imported, or false if it was created locally
        Throws:
        IllegalArgumentException - if the transaction does not belong to this provider
      • dropLocal

        public void dropLocal​(@NotNull
                              jakarta.transaction.Transaction transaction)
        Description copied from interface: LocalTransactionProvider
        Drop a local transaction from memory. The transaction is locally-initiated and contains no remote subordinate enlistments, guaranteeing that the transaction can never reappear on this node.
        Specified by:
        dropLocal in interface LocalTransactionProvider
        Parameters:
        transaction - the transaction to drop (not null)
      • dropRemote

        public void dropRemote​(@NotNull
                               jakarta.transaction.Transaction transaction)
        Description copied from interface: LocalTransactionProvider
        The transaction is expected to work with outflowed resources - it contains a remote subordinate enlistment. We can't use the LocalTransactionProvider.dropLocal(Transaction) directly as the the transaction may reapear on this node during recovery. But this method gives a chance to the provider to reassign the removal timeout or some other work that needs to be done in case the in-flight transaction finished.
        Specified by:
        dropRemote in interface LocalTransactionProvider
        Parameters:
        transaction - the transaction with ouflowed resources to announce of being finished (not null)
      • getTimeout

        public abstract int getTimeout​(@NotNull
                                       jakarta.transaction.Transaction transaction)
        Description copied from interface: LocalTransactionProvider
        Get the configured timeout of the given transaction (not the remaining time).
        Specified by:
        getTimeout in interface LocalTransactionProvider
        Parameters:
        transaction - the transaction (not null)
        Returns:
        the number of seconds remaining
      • getXid

        @NotNull
        public abstract Xid getXid​(@NotNull
                                   jakarta.transaction.Transaction transaction)
        Description copied from interface: LocalTransactionProvider
        Get the transaction ID of the given transaction.
        Specified by:
        getXid in interface LocalTransactionProvider
        Parameters:
        transaction - the transaction (not null)
        Returns:
        the transaction ID (must not be null)
      • getNameFromXid

        public String getNameFromXid​(@NotNull
                                     Xid xid)
        Description copied from interface: LocalTransactionProvider
        Attempt to derive a node name from an XID. If the XID is not in a recognized format, null is returned.
        Specified by:
        getNameFromXid in interface LocalTransactionProvider
        Parameters:
        xid - the XID (not null)
        Returns:
        the originating node name
      • getProviderInterface

        public <T> T getProviderInterface​(jakarta.transaction.Transaction transaction,
                                          Class<T> providerInterfaceType)
        Description copied from interface: LocalTransactionProvider
        Attempt to acquire a provider interface instance from the given provider transaction.
        Specified by:
        getProviderInterface in interface LocalTransactionProvider
        Type Parameters:
        T - the provider interface type
        Parameters:
        transaction - the provider transaction (not null)
        providerInterfaceType - the provider interface type class (not null)
        Returns:
        the provider interface instance, or null if none matches