ehcache

net.sf.ehcache.transaction.xa
Interface EhcacheXAResource

All Superinterfaces:
javax.transaction.xa.XAResource
All Known Implementing Classes:
EhcacheXAResourceImpl

public interface EhcacheXAResource
extends javax.transaction.xa.XAResource

EhcacheXAResource represents an Ehcache instance. It will provide the interface between the TransactionManager and the XATransactionalStore instance backing the transactional cache.

Author:
Nabib El-Rahman, Alex Snaps

Field Summary
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Method Summary
 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
 
Methods inherited from interface javax.transaction.xa.XAResource
commit, end, forget, getTransactionTimeout, isSameRM, prepare, recover, rollback, setTransactionTimeout, start
 

Method Detail

getCacheName

java.lang.String getCacheName()
Getter to the name of the cache wrapped by this XAResource

Returns:
Ehcache.getName() value

getStore

Store getStore()
Getter to the store wrapped by this XAResource

Returns:
the real underlying store (not the Transactional wrapper)

getOrCreateTransactionContext

TransactionContext getOrCreateTransactionContext()
                                                 throws SystemException,
                                                        RollbackException
Obtain the already associated TransactionContext with the current Transaction, or create a new one should none be there yet.

Returns:
The associated Transaction associated TransactionContext
Throws:
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.

get

Element get(java.lang.Object key)
Fall through methods to the underlying cache that will hit potential "guards" or "guarding read-only store"

Parameters:
key - the key to the Element to obtain form the underlying store
Returns:
the Element associated with the key, or null

getQuiet

Element getQuiet(java.lang.Object key)
Fall through methods to the underlying cache that will hit potential "guards" or "guarding read-only store"

Parameters:
key - the key to the Element to obtain form the underlying store
Returns:
the Element associated with the key, or null

ehcache

true