|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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,
ReadWriteCopyStrategy<Element> copyStrategy,
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, ReadWriteCopyStrategy<Element> copyStrategy, 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 factoryMethod Detail |
---|
public void start(Xid xid, int flag) throws XAException
start
in interface XAResource
XAException
public void end(Xid xid, int flag) throws XAException
end
in interface XAResource
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
XAException
public void forgetInternal(Xid xid) throws XAException
xid
- a XID
XAException
- when an error occurspublic int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean isSameRM(XAResource xaResource) throws XAException
isSameRM
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
XAException
public int prepareInternal(Xid xid) throws XAException
xid
- a XID
XAException
- when an error occurspublic void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public void commitInternal(Xid xid, boolean onePhase) throws XAException
xid
- a XIDonePhase
- true if onePhase, false otherwise
XAException
- when an error occurspublic Xid[] recover(int flags) throws XAException
recover
in interface XAResource
XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public void rollbackInternal(Xid xid) throws XAException
xid
- a XID
XAException
- when an error occurspublic boolean setTransactionTimeout(int timeout) throws XAException
setTransactionTimeout
in interface XAResource
XAException
public void addTwoPcExecutionListener(XAExecutionListener listener)
addTwoPcExecutionListener
in interface EhcacheXAResource
listener
- the XAExecutionListenerpublic String getCacheName()
getCacheName
in interface EhcacheXAResource
Ehcache.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 EhcacheXAResource
XATransactionContext
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 EhcacheXAResource
XATransactionContext
, 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 |