Class RemoteTransaction

    • Method Detail

      • getProviderInterface

        public <T> T getProviderInterface​(Class<T> providerInterfaceType)
        Description copied from class: AbstractTransaction
        Get a provider-specific interface from this transaction.
        Overrides:
        getProviderInterface in class AbstractTransaction
        Type Parameters:
        T - the provider interface type
        Parameters:
        providerInterfaceType - the provider interface type class (must not be null)
        Returns:
        the provider interface, or null if the given type isn't supported by this transaction's provider
      • commit

        public void commit()
                    throws jakarta.transaction.RollbackException,
                           jakarta.transaction.HeuristicMixedException,
                           jakarta.transaction.HeuristicRollbackException,
                           SecurityException,
                           jakarta.transaction.SystemException
        Specified by:
        commit in interface jakarta.transaction.Transaction
        Specified by:
        commit in class AbstractTransaction
        Throws:
        jakarta.transaction.RollbackException
        jakarta.transaction.HeuristicMixedException
        jakarta.transaction.HeuristicRollbackException
        SecurityException
        jakarta.transaction.SystemException
      • getStatus

        public int getStatus()
      • enlistResource

        public boolean enlistResource​(XAResource xaRes)
      • delistResource

        public boolean delistResource​(XAResource xaRes,
                                      int flag)
      • registerSynchronization

        public void registerSynchronization​(jakarta.transaction.Synchronization sync)
                                     throws jakarta.transaction.RollbackException,
                                            IllegalStateException,
                                            jakarta.transaction.SystemException
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getLocation

        public URI getLocation()
        Get the location of this remote transaction.
        Returns:
        the location of this remote transaction, or null if it has no location as of yet
      • setLocation

        public void setLocation​(URI location)
                         throws IllegalArgumentException,
                                IllegalStateException,
                                jakarta.transaction.SystemException
        Attempt to set the location of this transaction, binding it to a remote transport provider.
        Parameters:
        location - the location to set (must not be null)
        Throws:
        IllegalArgumentException - if there is no provider for the given location (or it is null), or the security context was invalid
        IllegalStateException - if the transaction is in an invalid state for setting its location
        jakarta.transaction.SystemException - if the transport could not begin the transaction
      • tryClearLocation

        public boolean tryClearLocation()
        Attempt to clear the location set on this transaction, disassociating it with the remote transport provider. There is only a limited time window at which this can occur, before the transaction is ever used. Typically this is only useful for retrying an initial invocation on a transaction.
        Returns:
        whether the attempt was successful