Package 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.XAResourceEhcacheXAResource represents anEhcacheinstance.- Author:
- Nabib El-Rahman, Alex Snaps
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTwoPcExecutionListener(XAExecutionListener listener)Add a listener which will be called back according to the 2PC lifecycleXATransactionContextcreateTransactionContext()Obtain the already associatedXATransactionContextwith the current Transaction, or create a new one should none be there yet.java.lang.StringgetCacheName()Getter to the name of the cache wrapped by this XAResourceXATransactionContextgetCurrentTransactionContext()Gets the currentXATransactionContextassociated with this resource
-
-
-
Method Detail
-
addTwoPcExecutionListener
void addTwoPcExecutionListener(XAExecutionListener listener)
Add a listener which will be called back according to the 2PC lifecycle- Parameters:
listener- the XAExecutionListener
-
getCacheName
java.lang.String getCacheName()
Getter to the name of the cache wrapped by this XAResource- Returns:
Ehcache.getName()value
-
createTransactionContext
XATransactionContext createTransactionContext() throws javax.transaction.SystemException, javax.transaction.RollbackException
Obtain the already associatedXATransactionContextwith the current Transaction, or create a new one should none be there yet.- Returns:
- The associated Transaction associated
XATransactionContext - Throws:
javax.transaction.SystemException- Thrown if the associated transaction manager encounters an unexpected error condition.javax.transaction.RollbackException- Thrown if the resource has to be enlisted with the transaction, while it is marked for rollback only.
-
getCurrentTransactionContext
XATransactionContext getCurrentTransactionContext()
Gets the currentXATransactionContextassociated with this resource- Returns:
- the current
XATransactionContext, or null if none
-
-