com.taobao.metamorphosis.client.transaction
类 TransactionContext

java.lang.Object
  继承者 com.taobao.metamorphosis.client.transaction.TransactionContext
所有已实现的接口:
XAResource

public class TransactionContext
extends Object
implements XAResource

事务上下文,同时支持本地事务和XA事务

作者:
boyan

字段摘要
static com.taobao.metamorphosis.client.transaction.TransactionContext.EndXATransactionListener END_XA_TX_LISTENER
           
static org.apache.commons.logging.Log log
           
 
从接口 javax.transaction.xa.XAResource 继承的字段
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
构造方法摘要
TransactionContext(com.taobao.gecko.service.RemotingClient remotingClient, String serverUrl, TransactionSession session, LongSequenceGenerator localTransactionIdGenerator, int transactionTimeout, long transactionRequestTimeoutInMills)
           
 
方法摘要
 void begin()
          下列方法为本地事务实现,begin,commit和rollback
 void commit()
           
 void commit(Xid xid, boolean onePhase)
           
 void end(Xid xid, int flags)
           
 void forget(Xid xid)
           
 TransactionId getTransactionId()
           
 int getTransactionTimeout()
           
 String getUniqueQualifier()
           
 String[] getXareresourceURLs()
           
 boolean isInLocalTransaction()
           
 boolean isInTransaction()
           
 boolean isInXATransaction()
           
 boolean isSameRM(XAResource xaResource)
           
 int prepare(Xid xid)
           
 Xid[] recover(int flag)
           
 void rollback()
           
 void rollback(Xid xid)
           
 void setServerUrl(String serverUrl)
           
 boolean setTransactionTimeout(int seconds)
           
 void setUniqueQualifier(String uniqueQualifier)
           
 void setXareresourceURLs(String[] xareresourceURLs)
           
 void start(Xid xid, int flags)
           
 String toString()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

END_XA_TX_LISTENER

public static final com.taobao.metamorphosis.client.transaction.TransactionContext.EndXATransactionListener END_XA_TX_LISTENER

log

public static final org.apache.commons.logging.Log log
构造方法详细信息

TransactionContext

public TransactionContext(com.taobao.gecko.service.RemotingClient remotingClient,
                          String serverUrl,
                          TransactionSession session,
                          LongSequenceGenerator localTransactionIdGenerator,
                          int transactionTimeout,
                          long transactionRequestTimeoutInMills)
方法详细信息

getXareresourceURLs

public String[] getXareresourceURLs()

setXareresourceURLs

public void setXareresourceURLs(String[] xareresourceURLs)

getUniqueQualifier

public String getUniqueQualifier()

setUniqueQualifier

public void setUniqueQualifier(String uniqueQualifier)

getTransactionId

public TransactionId getTransactionId()

setServerUrl

public void setServerUrl(String serverUrl)

isInXATransaction

public boolean isInXATransaction()

isInLocalTransaction

public boolean isInLocalTransaction()

isInTransaction

public boolean isInTransaction()

commit

public void commit(Xid xid,
                   boolean onePhase)
            throws XAException
指定者:
接口 XAResource 中的 commit
抛出:
XAException

end

public void end(Xid xid,
                int flags)
         throws XAException
指定者:
接口 XAResource 中的 end
抛出:
XAException

forget

public void forget(Xid xid)
            throws XAException
指定者:
接口 XAResource 中的 forget
抛出:
XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws XAException
指定者:
接口 XAResource 中的 getTransactionTimeout
抛出:
XAException

isSameRM

public boolean isSameRM(XAResource xaResource)
                 throws XAException
指定者:
接口 XAResource 中的 isSameRM
抛出:
XAException

prepare

public int prepare(Xid xid)
            throws XAException
指定者:
接口 XAResource 中的 prepare
抛出:
XAException

recover

public Xid[] recover(int flag)
              throws XAException
指定者:
接口 XAResource 中的 recover
抛出:
XAException

rollback

public void rollback(Xid xid)
              throws XAException
指定者:
接口 XAResource 中的 rollback
抛出:
XAException

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws XAException
指定者:
接口 XAResource 中的 setTransactionTimeout
抛出:
XAException

start

public void start(Xid xid,
                  int flags)
           throws XAException
指定者:
接口 XAResource 中的 start
抛出:
XAException

begin

public void begin()
           throws MetaClientException
下列方法为本地事务实现,begin,commit和rollback

抛出:
MetaClientException

commit

public void commit()
            throws MetaClientException
抛出:
MetaClientException

toString

public String toString()
覆盖:
Object 中的 toString

rollback

public void rollback()
              throws MetaClientException
抛出:
MetaClientException


Copyright © 2010–2013. All rights reserved.