Class WSATGatewayRM

java.lang.Object
com.sun.xml.ws.tx.at.internal.WSATGatewayRM
All Implemented Interfaces:
WSATRuntimeConfig.RecoveryEventListener, XAResource

public class WSATGatewayRM extends Object implements XAResource, WSATRuntimeConfig.RecoveryEventListener
Gateway XAResource for managing outbound WS-AT transaction branches.
  • Field Details

    • isReadyForRuntime

      public static boolean isReadyForRuntime
    • txlogdir

      public static String txlogdir
  • Method Details

    • getInstance

      public static WSATGatewayRM getInstance()
      called by transaction services for enlistment and used by HA delegation
    • create

      public static WSATGatewayRM create()
      Called during tube/web service init
    • registerWSATResource

      public Xid registerWSATResource(Xid xid, XAResource wsatResource, jakarta.transaction.Transaction tx) throws IllegalStateException, jakarta.transaction.RollbackException, jakarta.transaction.SystemException
      Enlist a foreign WS-AT resource in the current transaction. It is assumed that the XAResource parameter wraps a WS-AT endpoint. Invoked in the outbound case.
      Parameters:
      xid - The current, superior transaction id.
      wsatResource - The foreign WS-AT resource.
      Returns:
      Xid xid
      Throws:
      jakarta.transaction.SystemException - from enlistResource
      jakarta.transaction.RollbackException - from enlistResource
      IllegalStateException - from enlistResource
    • start

      public void start(Xid xid, int flags) throws XAException
      Implementation of Subordinate/ServerXAResource called in reaction to registerWSATResource enlistResource call This should be the only use/patch of this method NOTE: lock on currentBQual must be obtained before calling this method as it is in
      Specified by:
      start in interface XAResource
      Parameters:
      xid - Xid
      flags - flags
      Throws:
      XAException - xaException
    • end

      public void end(Xid xid, int flags) throws XAException
      Specified by:
      end in interface XAResource
      Throws:
      XAException
    • prepare

      public int prepare(Xid xid) throws XAException
      Specified by:
      prepare in interface XAResource
      Throws:
      XAException
    • commit

      public void commit(Xid xid, boolean onePhase) throws XAException
      Specified by:
      commit in interface XAResource
      Throws:
      XAException
    • rollback

      public void rollback(Xid xid) throws XAException
      Specified by:
      rollback in interface XAResource
      Throws:
      XAException
    • recover

      public void recover()
      Used for lazy/automatic-recovery="false"
    • recover

      public Xid[] recover(int flag) throws XAException
      Call for local recover/server specified by null instance value
      Specified by:
      recover in interface XAResource
      Returns:
      Xid[] indoubt Xids
      Throws:
      XAException
    • recover

      public Xid[] recover(int flag, String instance) throws XAException
      Call for delegated recovery specified by non-null instance
      Returns:
      Xid[] indoubt Xids
      Throws:
      XAException
    • forget

      public void forget(Xid xid) throws XAException
      Specified by:
      forget in interface XAResource
      Throws:
      XAException
    • getTransactionTimeout

      public int getTransactionTimeout()
      Not applicable
      Specified by:
      getTransactionTimeout in interface XAResource
      Returns:
      int -1 as not applicable
    • setTransactionTimeout

      public boolean setTransactionTimeout(int seconds)
      Not applicable
      Specified by:
      setTransactionTimeout in interface XAResource
      Parameters:
      seconds - int
      Returns:
      boolean always false as not applicable
    • isSameRM

      public boolean isSameRM(XAResource xares)
      There is only one WSATGatewayRM per server for active transactions and isSameRM should not be called for any migrated WSATGatewayRM instances
      Specified by:
      isSameRM in interface XAResource
      Parameters:
      xares - XAResource
      Returns:
      boolean if is same RM which in this WSATGatewayRM case means means the same instance
    • detectedUnavailable

      public boolean detectedUnavailable()
      Return true as WSATGatewayRM is always available, health should not change.
      Returns:
      boolean
    • getDelistFlag

      public int getDelistFlag()
      Always returns TMSUCCESS, avoids unnecessary suspend
      Returns:
      int TMSUCCESS delist flag
    • beforeRecovery

      public void beforeRecovery(boolean delegated, String instance)
      Description copied from interface: WSATRuntimeConfig.RecoveryEventListener
      Indicate to the listener that recovery for a specific instance is about to start.
      Specified by:
      beforeRecovery in interface WSATRuntimeConfig.RecoveryEventListener
      Parameters:
      delegated - identifies whether it is part of a delegated transaction recovery
      instance - the instance name for which transaction recovery is performed, null if unknown
    • afterRecovery

      public void afterRecovery(boolean success, boolean delegated, String instance)
      Description copied from interface: WSATRuntimeConfig.RecoveryEventListener
      Indicate to the listener that recovery is over.
      Specified by:
      afterRecovery in interface WSATRuntimeConfig.RecoveryEventListener
      Parameters:
      success - true if the recovery operation finished successfully
      delegated - identifies whether it is part of a delegated transaction recovery
      instance - the instance name for which transaction recovery is performed, null if unknown