Top Description Fields Methods
net.sf.ehcache.transaction.xa

public Interface EhcacheXAResource

extends XAResource
Known Direct Implementers
net.sf.ehcache.transaction.xa.EhcacheXAResourceImpl, net.sf.ehcache.transaction.local.JtaLocalTransactionStore.JtaLocalEhcacheXAResource
Imports
javax.transaction.RollbackException, .SystemException, javax.transaction.xa.XAResource

EhcacheXAResource represents an Ehcache instance.
Authors
Nabib El-Rahman, Alex Snaps

Field Summary

Inherited from javax.transaction.xa.XAResource:
TMENDRSCANTMFAILTMJOINTMNOFLAGSTMONEPHASETMRESUMETMSTARTRSCANTMSUCCESSTMSUSPENDXA_OKXA_RDONLY

Method Summary

Modifier and TypeMethod and Description
public void
addTwoPcExecutionListener(XAExecutionListener
the XAExecutionListener
listener
)

Add a listener which will be called back according to the 2PC lifecycle

public XATransactionContext

Returns:

The associated Transaction associated XATransactionContext
createTransactionContext
()

Obtain the already associated XATransactionContext with the current Transaction, or create a new one should none be there yet.

public String
getCacheName()

Getter to the name of the cache wrapped by this XAResource

public XATransactionContext

Returns:

the current XATransactionContext, or null if none
getCurrentTransactionContext
()

Gets the current XATransactionContext associated with this resource

Inherited from javax.transaction.xa.XAResource:
commitendforgetgetTransactionTimeoutisSameRMpreparerecoverrollbacksetTransactionTimeoutstart

Method Detail

addTwoPcExecutionListenerback to summary
public void addTwoPcExecutionListener(XAExecutionListener listener)

Add a listener which will be called back according to the 2PC lifecycle

Parameters
listener:XAExecutionListener

the XAExecutionListener

createTransactionContextback to summary
public 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:XATransactionContext

The associated Transaction associated XATransactionContext

Exceptions
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.
getCacheNameback to summary
public String getCacheName()

Getter to the name of the cache wrapped by this XAResource

Returns:String

net.sf.ehcache.Ehcache#getName value

getCurrentTransactionContextback to summary
public XATransactionContext getCurrentTransactionContext()

Gets the current XATransactionContext associated with this resource

Returns:XATransactionContext

the current XATransactionContext, or null if none