Class XAResourceRegistry


  • public abstract class XAResourceRegistry
    extends Object
    Registry that keeps track of outflowed resources info for a specific transaction. Used for recovery of those resources when they enter in doubt state.
    Author:
    Flavia Rainone
    • Constructor Detail

      • XAResourceRegistry

        public XAResourceRegistry()
    • Method Detail

      • addResource

        protected abstract void addResource​(XAResource resource,
                                            Xid xid,
                                            URI uri)
                                     throws jakarta.transaction.SystemException
        Adds a XA resource to this registry.
        Parameters:
        resource - the resource
        uri - the resource URI location
        Throws:
        jakarta.transaction.SystemException - if there is a problem recording this resource
      • removeResource

        protected abstract void removeResource​(XAResource resource)
                                        throws XAException
        Removes a XA resource from this registry.
        Parameters:
        resource - the resource
        Throws:
        XAException - if there is a problem deleting this resource
      • resourceInDoubt

        protected abstract void resourceInDoubt​(XAResource resource)
        Flags the previously added resource as in doubt, meaning that it failed to complete prepare, rollback or commit. It can be invoked more than once for the same resource if that resource repeatedly fails to perform those operations, such as a resource that first fails to prepare, and then fails to rollback.
        Parameters:
        resource - the resource
      • reloadInDoubtResource

        protected XAResource reloadInDoubtResource​(URI uri,
                                                   String nodeName,
                                                   Xid xid)
        Reloads an in doubt resource, recreating a previously lost remote XA resource object. This method must be invoked to recreate in doubt resources after a server shutdown or crash.
        Parameters:
        uri - the URI where the outflowed resource is located
        nodeName - the node name of the resource
        Returns:
        a newly-created resource representing a previously lost XA resource that is in doubt