java.lang.Object
org.mule.util.xa.DefaultXASession<T>
- Type Parameters:
T - type of the AbstractXaTransactionContext created for each transaction
- All Implemented Interfaces:
- XAResource
- Direct Known Subclasses:
- QueueXaResource
public abstract class DefaultXASession<T extends AbstractXaTransactionContext>
- extends Object
- implements XAResource
Base class for an XAResource implementation.
| Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected transient org.apache.commons.logging.Log logger
localXid
protected Xid localXid
resourceManager
protected AbstractXAResourceManager<T extends AbstractXaTransactionContext> resourceManager
localContext
protected T extends AbstractXaTransactionContext localContext
DefaultXASession
public DefaultXASession(AbstractXAResourceManager resourceManager)
getXAResource
public XAResource getXAResource()
getResourceManager
public Object getResourceManager()
isSameRM
public boolean isSameRM(XAResource xares)
throws XAException
- Specified by:
isSameRM in interface XAResource
- Throws:
XAException
start
public void start(Xid xid,
int flags)
throws XAException
- Specified by:
start in interface XAResource
- Throws:
XAException
end
public void end(Xid xid,
int flags)
throws XAException
- Specified by:
end 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
prepare
public int prepare(Xid xid)
throws XAException
- Specified by:
prepare in interface XAResource
- Throws:
XAException
forget
public void forget(Xid xid)
throws XAException
- Specified by:
forget in interface XAResource
- Throws:
XAException
getTransactionTimeout
public int getTransactionTimeout()
throws XAException
- Specified by:
getTransactionTimeout in interface XAResource
- Throws:
XAException
setTransactionTimeout
public boolean setTransactionTimeout(int timeout)
throws XAException
- Specified by:
setTransactionTimeout in interface XAResource
- Throws:
XAException
getTransactionContext
public T getTransactionContext()
commitDanglingTransaction
protected abstract void commitDanglingTransaction(Xid xid,
boolean onePhase)
throws XAException
- Commits a dangling transaction that can be caused by the failure of one
of the XAResource involved in the transaction or a crash of the transaction manager.
- Parameters:
xid - transaction identifieronePhase - if the commit should be done using only one phase commit
- Throws:
XAException
rollbackDandlingTransaction
protected abstract void rollbackDandlingTransaction(Xid xid)
throws XAException
- Commits a dangling transaction that can be caused by the failure of one
of the XAResource involved in the transaction or a crash of the transaction manager.
- Parameters:
xid - transaction identifier
- Throws:
XAException
createTransactionContext
protected abstract T createTransactionContext(Xid xid)
- Creates a new transaction context with the given transaction identifier
- Parameters:
xid - transaction identifier
- Returns:
- the new transaction context
Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.