public class EhcacheXAResourceImpl extends Object implements EhcacheXAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY| Constructor and Description |
|---|
EhcacheXAResourceImpl(Ehcache cache,
Store underlyingStore,
TransactionManagerLookup txnManagerLookup,
SoftLockManager softLockManager,
TransactionIDFactory transactionIDFactory,
ReadWriteCopyStrategy<Element> copyStrategy)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
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() |
public EhcacheXAResourceImpl(Ehcache cache, Store underlyingStore, TransactionManagerLookup txnManagerLookup, SoftLockManager softLockManager, TransactionIDFactory transactionIDFactory, ReadWriteCopyStrategy<Element> copyStrategy)
cache - the cacheunderlyingStore - the underlying storetxnManagerLookup - the transaction manager lookupsoftLockManager - the soft lock managertransactionIDFactory - the transaction ID factorypublic void start(Xid xid, int flag) throws XAException
start in interface XAResourceXAExceptionpublic void end(Xid xid, int flag) throws XAException
end in interface XAResourceXAExceptionpublic void forget(Xid xid) throws XAException
forget in interface XAResourceXAExceptionpublic void forgetInternal(Xid xid) throws XAException
xid - a XIDXAException - when an error occurspublic int getTransactionTimeout()
throws XAException
getTransactionTimeout in interface XAResourceXAExceptionpublic boolean isSameRM(XAResource xaResource) throws XAException
isSameRM in interface XAResourceXAExceptionpublic int prepare(Xid xid) throws XAException
prepare in interface XAResourceXAExceptionpublic int prepareInternal(Xid xid) throws XAException
xid - a XIDXAException - when an error occurspublic void commit(Xid xid, boolean onePhase) throws XAException
commit in interface XAResourceXAExceptionpublic void commitInternal(Xid xid, boolean onePhase) throws XAException
xid - a XIDonePhase - true if onePhase, false otherwiseXAException - when an error occurspublic Xid[] recover(int flags) throws XAException
recover in interface XAResourceXAExceptionpublic void rollback(Xid xid) throws XAException
rollback in interface XAResourceXAExceptionpublic void rollbackInternal(Xid xid) throws XAException
xid - a XIDXAException - when an error occurspublic 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() valuepublic XATransactionContext createTransactionContext() throws SystemException, RollbackException
XATransactionContext with the current Transaction,
or create a new one should none be there yet.createTransactionContext in interface EhcacheXAResourceXATransactionContextSystemException - 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 resourcegetCurrentTransactionContext in interface EhcacheXAResourceXATransactionContext, or null if noneCopyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.