Class WSATXAResource

    • Constructor Detail

      • WSATXAResource

        public WSATXAResource​(javax.xml.ws.EndpointReference epr,
                              Xid xid)
        Constructor used for runtime
        Parameters:
        epr - SEndpointReference participant endpoint reference
        xid - Xid of transaction
      • WSATXAResource

        public WSATXAResource​(Transactional.Version version,
                              javax.xml.ws.EndpointReference epr,
                              Xid xid)
        Constructor used for runtime
        Parameters:
        version - Transactional.Version
        epr - EndpointReference participant endpoint reference
        xid - Xid of transaction
      • WSATXAResource

        public WSATXAResource​(Transactional.Version version,
                              javax.xml.ws.EndpointReference epr,
                              Xid xid,
                              boolean isRecovery)
        Constructor used for recovery
        Parameters:
        version - Transactional.Version
        epr - EndpointReference participant endpoint reference
        xid - Xid of transaction
        isRecovery - true if for recovery, false if not (ie if for runtime)
    • Method Detail

      • setStatus

        public void setStatus​(String status)
        Called by Coordinator service in reaction to completion operation call in order to setStatus accordingly
        Parameters:
        status - String status as found in WSATConstants.
      • prepare

        public int prepare​(Xid xid)
                    throws XAException
        Specified by:
        prepare in interface XAResource
        Parameters:
        xid - Xid The actual Xid passed in is ignored and the member variable used instead as the value passed in as there is a final 1-to-1 relationship between WSATXAResource and Xid. In reality is doesn't matter but in order to be consistent with rollback (where it does matter), the member variable is used
        Returns:
        int prepare vote
        Throws:
        XAException - xaException
      • finalize

        protected void finalize()
                         throws Throwable
        Prevents leaks in the event of protocol exceptions, abandonments, etc. This has the requirement that transactions are never recreated for recovery from scratch using in-memory records
        Overrides:
        finalize in class Object
        Throws:
        Throwable - he Exception raised by this method
      • commit

        public void commit​(Xid xid,
                           boolean onePhase)
                    throws XAException
        Commit.
        Specified by:
        commit in interface XAResource
        Parameters:
        xid - Xid The actual Xid passed in is ignored and the member variable used instead as there is a final 1-to-1 relationship between WSATXAResource and Xid during construction. In reality is doesn't matter but in order to be consistent with rollback (where it does matter), the member variable is used
        onePhase - there is no single phase commit in WS-AT and so this is ignored
        Throws:
        XAException - xaException
      • rollback

        public void rollback​(Xid xid)
                      throws XAException
        Specified by:
        rollback in interface XAResource
        Parameters:
        xid - Xid The actual Xid passed in is ignored and the member variable used instead as the value passed in will be null for bottom-up recovery and because there is a final 1-to-1 relationship between WSATXAResource and Xid.
        Throws:
        XAException
      • end

        public void end​(Xid xid,
                        int i)
                 throws XAException
        Not applicable to WS-AT
        Specified by:
        end in interface XAResource
        Parameters:
        xid - Xid
        i - flag
        Throws:
        XAException - xaexception
      • isSameRM

        public boolean isSameRM​(XAResource xaResource)
                         throws XAException
        Not applicable to WS-AT
        Specified by:
        isSameRM in interface XAResource
        Parameters:
        xaResource - XAResource
        Returns:
        boolean must be false
        Throws:
        XAException - xaexeception
      • recover

        public Xid[] recover​(int i)
                      throws XAException
        Not applicable to WS-AT
        Specified by:
        recover in interface XAResource
        Parameters:
        i - flag
        Returns:
        empty array
        Throws:
        XAException - xaexception
      • getXid

        public Xid getXid()
        Returns Xid for use in equality, as key in durable participant map, and from gateway registerWSATResource of subordinate/participant.
        Returns:
        Xid that identifies this XAResource
      • setBranchQualifier

        public void setBranchQualifier​(byte[] bqual)
        Called from Registration to set branch qualifier that was generated during enlist
        Parameters:
        bqual - byte[]
      • setXid

        public void setXid​(Xid xid)
      • equals

        public boolean equals​(Object obj)
        Equality check based on instanceof and Xid that identifies this Synchronization
        Overrides:
        equals in class Object
        Parameters:
        obj - Object to conduct equality check against
        Returns:
        if equal