com.sun.xml.ws.tx.at.internal
Class WSATGatewayRM

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

public class WSATGatewayRM
extends java.lang.Object
implements javax.transaction.xa.XAResource, WSATRuntimeConfig.RecoveryEventListener

Gateway XAResource for managing outbound WS-AT transaction branches.


Field Summary
static boolean isReadyForRuntime
           
static java.lang.String txlogdir
           
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Method Summary
 void afterRecovery(boolean success, boolean delegated, java.lang.String instance)
           
 void beforeRecovery(boolean delegated, java.lang.String instance)
           
 void commit(javax.transaction.xa.Xid xid, boolean onePhase)
           
static WSATGatewayRM create()
          Called during tube/web service init
 boolean detectedUnavailable()
          Return true as WSATGatewayRM is always available, health should not change.
 void end(javax.transaction.xa.Xid xid, int flags)
           
 void forget(javax.transaction.xa.Xid xid)
           
 int getDelistFlag()
          Always returns TMSUCCESS, avoids unnecessary suspend
static WSATGatewayRM getInstance()
          called by transaction services for enlistment and used by HA delegation
 int getTransactionTimeout()
          Not applicable
 boolean isSameRM(javax.transaction.xa.XAResource xares)
          There is only one WSATGatewayRM per server for active transactions and isSameRM should not be called for any migrated WSATGatewayRM instances
 int prepare(javax.transaction.xa.Xid xid)
           
 void recover()
          Used for lazy/automatic-recovery="false"
 javax.transaction.xa.Xid[] recover(int flag)
          Call for local recover/server specified by null instance value
 javax.transaction.xa.Xid[] recover(int flag, java.lang.String instance)
          Call for delegated recovery specified by non-null instance
 javax.transaction.xa.Xid registerWSATResource(javax.transaction.xa.Xid xid, javax.transaction.xa.XAResource wsatResource, javax.transaction.Transaction tx)
          Enlist a foreign WS-AT resource in the current transaction.
 void rollback(javax.transaction.xa.Xid xid)
           
 boolean setTransactionTimeout(int seconds)
          Not applicable
 void start(javax.transaction.xa.Xid xid, int flags)
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isReadyForRuntime

public static boolean isReadyForRuntime

txlogdir

public static java.lang.String txlogdir
Method Detail

getInstance

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

Returns:

create

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

Returns:

registerWSATResource

public javax.transaction.xa.Xid registerWSATResource(javax.transaction.xa.Xid xid,
                                                     javax.transaction.xa.XAResource wsatResource,
                                                     javax.transaction.Transaction tx)
                                              throws java.lang.IllegalStateException,
                                                     javax.transaction.RollbackException,
                                                     javax.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:
javax.transaction.SystemException - from enlistResource
javax.transaction.RollbackException - from enlistResource
java.lang.IllegalStateException - from enlistResource

start

public void start(javax.transaction.xa.Xid xid,
                  int flags)
           throws javax.transaction.xa.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 javax.transaction.xa.XAResource
Parameters:
xid - Xid
flags - flags
Throws:
javax.transaction.xa.XAException - xaException

end

public void end(javax.transaction.xa.Xid xid,
                int flags)
         throws javax.transaction.xa.XAException
Specified by:
end in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException

prepare

public int prepare(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Specified by:
prepare in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException

commit

public void commit(javax.transaction.xa.Xid xid,
                   boolean onePhase)
            throws javax.transaction.xa.XAException
Specified by:
commit in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException

rollback

public void rollback(javax.transaction.xa.Xid xid)
              throws javax.transaction.xa.XAException
Specified by:
rollback in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException

recover

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


recover

public javax.transaction.xa.Xid[] recover(int flag)
                                   throws javax.transaction.xa.XAException
Call for local recover/server specified by null instance value

Specified by:
recover in interface javax.transaction.xa.XAResource
Parameters:
flag -
Returns:
Xid[] indoubt Xids
Throws:
javax.transaction.xa.XAException

recover

public javax.transaction.xa.Xid[] recover(int flag,
                                          java.lang.String instance)
                                   throws javax.transaction.xa.XAException
Call for delegated recovery specified by non-null instance

Parameters:
flag -
instance -
Returns:
Xid[] indoubt Xids
Throws:
javax.transaction.xa.XAException

forget

public void forget(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Specified by:
forget in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws javax.transaction.xa.XAException
Not applicable

Specified by:
getTransactionTimeout in interface javax.transaction.xa.XAResource
Returns:
int -1 as not applicable
Throws:
javax.transaction.xa.XAException

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws javax.transaction.xa.XAException
Not applicable

Specified by:
setTransactionTimeout in interface javax.transaction.xa.XAResource
Parameters:
seconds - int
Returns:
boolean always false as not applicable
Throws:
javax.transaction.xa.XAException - xaException

isSameRM

public boolean isSameRM(javax.transaction.xa.XAResource xares)
                 throws javax.transaction.xa.XAException
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 javax.transaction.xa.XAResource
Parameters:
xares - XAResource
Returns:
boolean if is same RM which in this WSATGatewayRM case means means the same instance
Throws:
javax.transaction.xa.XAException

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,
                           java.lang.String instance)
Specified by:
beforeRecovery in interface WSATRuntimeConfig.RecoveryEventListener

afterRecovery

public void afterRecovery(boolean success,
                          boolean delegated,
                          java.lang.String instance)
Specified by:
afterRecovery in interface WSATRuntimeConfig.RecoveryEventListener


Copyright © 2005-2011 Oracle Corporation. All Rights Reserved.