Class WSATXAResource

java.lang.Object
com.sun.xml.ws.tx.at.WSATXAResource
All Implemented Interfaces:
WSATConstants, Serializable, XAResource

public class WSATXAResource extends Object implements WSATConstants, XAResource, Serializable
See Also:
  • Constructor Details

    • WSATXAResource

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

      public WSATXAResource(com.sun.xml.ws.api.tx.at.Transactional.Version version, jakarta.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(com.sun.xml.ws.api.tx.at.Transactional.Version version, jakarta.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 Details

    • 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
    • forget

      public void forget(Xid xid)
      Not applicable to WS-AT
      Specified by:
      forget in interface XAResource
      Parameters:
      xid - Xid
    • setTransactionTimeout

      public boolean setTransactionTimeout(int i)
      Not applicable to WS-AT
      Specified by:
      setTransactionTimeout in interface XAResource
      Parameters:
      i - timeout
      Returns:
      boolean
    • start

      public void start(Xid xid, int i)
      Not applicable to WS-AT
      Specified by:
      start in interface XAResource
      Parameters:
      xid - Xid
      i - flag
    • end

      public void end(Xid xid, int i)
      Not applicable to WS-AT
      Specified by:
      end in interface XAResource
      Parameters:
      xid - Xid
      i - flag
    • getTransactionTimeout

      public int getTransactionTimeout()
      Not applicable to WS-AT
      Specified by:
      getTransactionTimeout in interface XAResource
      Returns:
      int timeout
    • isSameRM

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

      public Xid[] recover(int i)
      Not applicable to WS-AT
      Specified by:
      recover in interface XAResource
      Parameters:
      i - flag
      Returns:
      empty array
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object