Package com.sun.xml.ws.tx.at.internal
Class WSATGatewayRM
- java.lang.Object
-
- com.sun.xml.ws.tx.at.internal.WSATGatewayRM
-
- All Implemented Interfaces:
com.sun.xml.ws.tx.dev.WSATRuntimeConfig.RecoveryEventListener,XAResource
public class WSATGatewayRM extends Object implements XAResource, com.sun.xml.ws.tx.dev.WSATRuntimeConfig.RecoveryEventListener
Gateway XAResource for managing outbound WS-AT transaction branches.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanisReadyForRuntimestatic Stringtxlogdir-
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterRecovery(boolean success, boolean delegated, String instance)voidbeforeRecovery(boolean delegated, String instance)voidcommit(Xid xid, boolean onePhase)static WSATGatewayRMcreate()Called during tube/web service initbooleandetectedUnavailable()Return true as WSATGatewayRM is always available, health should not change.voidend(Xid xid, int flags)voidforget(Xid xid)intgetDelistFlag()Always returns TMSUCCESS, avoids unnecessary suspendstatic WSATGatewayRMgetInstance()called by transaction services for enlistment and used by HA delegationintgetTransactionTimeout()Not applicablebooleanisSameRM(XAResource xares)There is only one WSATGatewayRM per server for active transactions and isSameRM should not be called for any migrated WSATGatewayRM instancesintprepare(Xid xid)voidrecover()Used for lazy/automatic-recovery="false"Xid[]recover(int flag)Call for local recover/server specified by null instance valueXid[]recover(int flag, String instance)Call for delegated recovery specified by non-null instanceXidregisterWSATResource(Xid xid, XAResource wsatResource, javax.transaction.Transaction tx)Enlist a foreign WS-AT resource in the current transaction.voidrollback(Xid xid)booleansetTransactionTimeout(int seconds)Not applicablevoidstart(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
-
-
-
Field Detail
-
isReadyForRuntime
public static boolean isReadyForRuntime
-
txlogdir
public static 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 Xid registerWSATResource(Xid xid, XAResource wsatResource, javax.transaction.Transaction tx) throws 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 enlistResourcejavax.transaction.RollbackException- from enlistResourceIllegalStateException- 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:
startin interfaceXAResource- Parameters:
xid- Xidflags- flags- Throws:
XAException- xaException
-
end
public void end(Xid xid, int flags) throws XAException
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
prepare
public int prepare(Xid xid) throws XAException
- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
commit
public void commit(Xid xid, boolean onePhase) throws XAException
- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
rollback
public void rollback(Xid xid) throws XAException
- Specified by:
rollbackin interfaceXAResource- 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:
recoverin interfaceXAResource- Parameters:
flag-- 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- Parameters:
flag-instance-- Returns:
- Xid[] indoubt Xids
- Throws:
XAException
-
forget
public void forget(Xid xid) throws XAException
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAExceptionNot applicable- Specified by:
getTransactionTimeoutin interfaceXAResource- Returns:
- int -1 as not applicable
- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAExceptionNot applicable- Specified by:
setTransactionTimeoutin interfaceXAResource- Parameters:
seconds- int- Returns:
- boolean always false as not applicable
- Throws:
XAException- xaException
-
isSameRM
public boolean isSameRM(XAResource xares) throws XAException
There is only one WSATGatewayRM per server for active transactions and isSameRM should not be called for any migrated WSATGatewayRM instances- Specified by:
isSameRMin interfaceXAResource- Parameters:
xares- XAResource- Returns:
- boolean if is same RM which in this WSATGatewayRM case means means the same instance
- Throws:
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, String instance)- Specified by:
beforeRecoveryin interfacecom.sun.xml.ws.tx.dev.WSATRuntimeConfig.RecoveryEventListener
-
afterRecovery
public void afterRecovery(boolean success, boolean delegated, String instance)- Specified by:
afterRecoveryin interfacecom.sun.xml.ws.tx.dev.WSATRuntimeConfig.RecoveryEventListener
-
-