|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ehcache.transaction.xa.EhcacheXAResourceImpl
public class EhcacheXAResourceImpl
The EhcacheXAResource implementation
| Field Summary |
|---|
| Fields inherited from interface javax.transaction.xa.XAResource |
|---|
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
| Constructor Summary | |
|---|---|
EhcacheXAResourceImpl(Ehcache cache,
Store underlyingStore,
TransactionManagerLookup txnManagerLookup,
SoftLockManager softLockManager,
TransactionIDFactory transactionIDFactory,
ElementValueComparator comparator,
org.terracotta.statistics.observer.OperationObserver<XaCommitOutcome> commitObserver,
org.terracotta.statistics.observer.OperationObserver<XaRollbackOutcome> rollbackObserver,
org.terracotta.statistics.observer.OperationObserver<XaRecoveryOutcome> recoveryObserver)
Constructor |
|
| Method Summary | |
|---|---|
void |
addTwoPcExecutionListener(XAExecutionListener listener)
Add a listener which will be called back according to the 2PC lifecycle |
void |
commit(Xid xid,
boolean onePhase)
|
void |
commitInternal(Xid xid,
boolean onePhase)
The commit implementation |
XATransactionContext |
createTransactionContext()
Obtain the already associated XATransactionContext with the current Transaction,
or create a new one should none be there yet. |
void |
end(Xid xid,
int flag)
|
void |
forget(Xid xid)
|
void |
forgetInternal(Xid xid)
The forget implementation |
String |
getCacheName()
Getter to the name of the cache wrapped by this XAResource |
XATransactionContext |
getCurrentTransactionContext()
Gets the current XATransactionContext associated with this resource |
int |
getTransactionTimeout()
|
boolean |
isSameRM(XAResource xaResource)
|
int |
prepare(Xid xid)
|
int |
prepareInternal(Xid xid)
The prepare implementation |
Xid[] |
recover(int flags)
|
void |
rollback(Xid xid)
|
void |
rollbackInternal(Xid xid)
The rollback implementation |
boolean |
setTransactionTimeout(int timeout)
|
void |
start(Xid xid,
int flag)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EhcacheXAResourceImpl(Ehcache cache,
Store underlyingStore,
TransactionManagerLookup txnManagerLookup,
SoftLockManager softLockManager,
TransactionIDFactory transactionIDFactory,
ElementValueComparator comparator,
org.terracotta.statistics.observer.OperationObserver<XaCommitOutcome> commitObserver,
org.terracotta.statistics.observer.OperationObserver<XaRollbackOutcome> rollbackObserver,
org.terracotta.statistics.observer.OperationObserver<XaRecoveryOutcome> recoveryObserver)
cache - the cacheunderlyingStore - the underlying storetxnManagerLookup - the transaction manager lookupsoftLockManager - the soft lock managertransactionIDFactory - the transaction ID factorycomparator - the element value comparator| Method Detail |
|---|
public void start(Xid xid,
int flag)
throws XAException
start in interface XAResourceXAException
public void end(Xid xid,
int flag)
throws XAException
end in interface XAResourceXAException
public void forget(Xid xid)
throws XAException
forget in interface XAResourceXAException
public void forgetInternal(Xid xid)
throws XAException
xid - a XID
XAException - when an error occurs
public int getTransactionTimeout()
throws XAException
getTransactionTimeout in interface XAResourceXAException
public boolean isSameRM(XAResource xaResource)
throws XAException
isSameRM in interface XAResourceXAException
public int prepare(Xid xid)
throws XAException
prepare in interface XAResourceXAException
public int prepareInternal(Xid xid)
throws XAException
xid - a XID
XAException - when an error occurs
public void commit(Xid xid,
boolean onePhase)
throws XAException
commit in interface XAResourceXAException
public void commitInternal(Xid xid,
boolean onePhase)
throws XAException
xid - a XIDonePhase - true if onePhase, false otherwise
XAException - when an error occurs
public Xid[] recover(int flags)
throws XAException
recover in interface XAResourceXAException
public void rollback(Xid xid)
throws XAException
rollback in interface XAResourceXAException
public void rollbackInternal(Xid xid)
throws XAException
xid - a XID
XAException - when an error occurs
public boolean setTransactionTimeout(int timeout)
throws XAException
setTransactionTimeout in interface XAResourceXAExceptionpublic void addTwoPcExecutionListener(XAExecutionListener listener)
addTwoPcExecutionListener in interface EhcacheXAResourcelistener - the XAExecutionListenerpublic String getCacheName()
getCacheName in interface EhcacheXAResourceEhcache.getName() value
public XATransactionContext createTransactionContext()
throws SystemException,
RollbackException
XATransactionContext with the current Transaction,
or create a new one should none be there yet.
createTransactionContext in interface EhcacheXAResourceXATransactionContext
SystemException - Thrown if the associated transaction manager encounters an unexpected error condition.
RollbackException - Thrown if the resource has to be enlisted with the transaction, while it is marked for rollback only.public XATransactionContext getCurrentTransactionContext()
XATransactionContext associated with this resource
getCurrentTransactionContext in interface EhcacheXAResourceXATransactionContext, or null if nonepublic String toString()
toString in class Object
|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||