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 |
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.