|
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
Default implementation for EhcacheXAResource.
It encapsulates the store to be accessed in a transactional way, the TransactionManager
and an EhcacheXAStore
, where it'll save transaction data during
the two-phase commit process, and between suspend/resume transaction cycles.
It'll also associate Transaction
instances with their Xid
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,
TransactionManager txnManager,
EhcacheXAStore ehcacheXAStore)
Constructor |
Method Summary | |
---|---|
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
|
void |
end(javax.transaction.xa.Xid xid,
int flags)
|
boolean |
equals(java.lang.Object obj)
|
void |
forget(javax.transaction.xa.Xid xid)
|
Element |
get(java.lang.Object key)
Fall through methods to the underlying cache that will hit potential "guards" or "guarding read-only store" |
java.lang.String |
getCacheName()
Getter to the name of the cache wrapped by this XAResource |
TransactionContext |
getOrCreateTransactionContext()
Obtain the already associated TransactionContext with the current Transaction,
or create a new one should none be there yet. |
Element |
getQuiet(java.lang.Object key)
Fall through methods to the underlying cache that will hit potential "guards" or "guarding read-only store" |
Store |
getStore()
Getter to the store wrapped by this XAResource |
int |
getTransactionTimeout()
|
int |
hashCode()
|
boolean |
isSameRM(javax.transaction.xa.XAResource xaResource)
|
int |
prepare(javax.transaction.xa.Xid xid)
|
javax.transaction.xa.Xid[] |
recover(int flags)
|
void |
rollback(javax.transaction.xa.Xid xid)
|
boolean |
setTransactionTimeout(int i)
|
void |
start(javax.transaction.xa.Xid xid,
int flags)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EhcacheXAResourceImpl(Ehcache cache, TransactionManager txnManager, EhcacheXAStore ehcacheXAStore)
cache
- The cache name of the Cache wrappedtxnManager
- the TransactionManager associated with this XAResourceehcacheXAStore
- The EhcacheXAStore for this cacheMethod Detail |
---|
public java.lang.String getCacheName()
getCacheName
in interface EhcacheXAResource
Ehcache.getName()
valuepublic void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public javax.transaction.xa.Xid[] recover(int flags) throws javax.transaction.xa.XAException
recover
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public boolean isSameRM(javax.transaction.xa.XAResource xaResource) throws javax.transaction.xa.XAException
isSameRM
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public boolean setTransactionTimeout(int i) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public Store getStore()
getStore
in interface EhcacheXAResource
public TransactionContext getOrCreateTransactionContext() throws SystemException, RollbackException
TransactionContext
with the current Transaction,
or create a new one should none be there yet.
getOrCreateTransactionContext
in interface EhcacheXAResource
TransactionContext
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 Element get(java.lang.Object key)
get
in interface EhcacheXAResource
key
- the key to the Element to obtain form the underlying store
public Element getQuiet(java.lang.Object key)
getQuiet
in interface EhcacheXAResource
key
- the key to the Element to obtain form the underlying store
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |