ehcache

net.sf.ehcache.transaction.xa
Interface EhcacheXAResource

All Superinterfaces:
XAResource
All Known Implementing Classes:
EhcacheXAResourceImpl

public interface EhcacheXAResource
extends XAResource

EhcacheXAResource represents an Ehcache instance.

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
 void addTwoPcExecutionListener(XAExecutionListener listener)
          Add a listener which will be called back according to the 2PC lifecycle
 XATransactionContext createTransactionContext()
          Obtain the already associated XATransactionContext with the current Transaction, or create a new one should none be there yet.
 String getCacheName()
          Getter to the name of the cache wrapped by this XAResource
 XATransactionContext getCurrentTransactionContext()
          Gets the current XATransactionContext associated with this resource
 
Methods inherited from interface javax.transaction.xa.XAResource
commit, end, forget, getTransactionTimeout, isSameRM, prepare, recover, rollback, setTransactionTimeout, start
 

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

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

Returns:
Ehcache.getName() value

createTransactionContext

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

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

getCurrentTransactionContext

XATransactionContext getCurrentTransactionContext()
Gets the current XATransactionContext associated with this resource

Returns:
the current XATransactionContext, or null if none

ehcache

Copyright 2001-2016, Terracotta, Inc.